經過反覆測試,通過client連接/etc/hosts解析的SCAN方式的11gR2,依然有load balance的

原文自:http://www.aixchina.net/home/space.php?uid=15081&do=blog&id=25746

引子:

oracle 11gR2 SACN 使用hosts的疑問

http://www.aixchina.net/club/viewthread.php?tid=30788&page=1&extra=#pid418599

這二天搭建的虛擬機安裝11G GRID,資源不夠,跑得慢,沒有裝完,暫時無法做這個試驗,有一個問題在這請教下,關於oracle11gR2的SCAN如果用/etc/hosts來解析,會出現什麼後果?只會和一個VIP地址連接,CLIENT的連接全部在一個節點上嗎?即沒有負載均衡的功能了?
順便請問下,client中是必須配置SCAN NAME?還是可以像以前一樣配置VIP地址的連接串?

罈子裏的朋友建議用VIP的連接串,但我真是想知道到底是什麼情況。。。

當時我查閱資料記錄:

  1. Clients configured to use IP addresses for Oracle Database releases prior to Oracle Database 11g release 2 can continue to use their existing connection addresses;using SCANs is not required. 
  2. When you upgrade to Oracle Clusterware 11g release 2 (11.2),the SCAN becomes available, and you should use the SCAN for connections to OracleDatabase 11g release 2 or later databases. When an earlier version of Oracle Database isupgraded, it registers with the SCAN listeners, and clients can start using the SCAN to cnnect to that database. The database registers with the SCAN listener through the remote listener parameter in the init.ora file. The REMOTE_LISTENER parameter must be set to SCAN:PORT. Do not set it to a  NSNAMES alias with a single address with the SCAN as HOST=SCAN.
  3. If you use the hosts file to resolve SCANs, then you will only be able to resolve to one IP address and you will have only one SCAN address.
    對於這句話,當時的理解問題是:如果用/etc/hosts解析,是不是隻能一直連接到一個RAC節點上呀?

我當時的理解:
1,如果2個節點,用hosts配置SCAN,則用CLIENT連接時,直接使用VIP連接串,跳過SCAN LISTERNER。即不使用SCAN的功能;

2,如果用HOSTS配置 SCAN,用CLIENT連接配置SCAN連接串的話,從引用的哪句話來看理解上來看應該是隻能一直連在一個RAC節點的VIP LISTER上。

---------------------------------------------------------------------------------------------------------------------------------

測試結果:

環境:2個VM rhel5+openfiler,採用hosts方式,爲了驗證上面那句話,我配置了3個scan ip在hosts表裏。。。

1,grid安裝完成,crs_stat -t只有一個scan服務;

-------〉無論配幾個scan在hosts裏,都只有1個生效。而且是識別hosts的第一個scan行。

2,2個節點的監聽,只有一個SCAN監聽;

-------〉當時還真不確定有沒有load balance功能。。。

 

測試結果:/etc/hosts解析的SCAN方式的11gR2,依然有load balance的能力。

1)此方法只有1個SCAN能夠使用。

2)   經過反覆用clint連接,退出測試,在2節點netstat -an|grep 1521觀察連接情況,我的clint連接一時在A節點,一時在B節點。

------------------------

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章