【RAC】部署RAC時勿將系統主機名保留在環路地址中

secooler發表於2010-10-06
這裡想要提醒注意的內容是:請不要將系統主機名保留在環路地址中。
記錄一下這個過程,供參考。

1.問題再現
1)RAC第一節點演示記錄資訊
(1)系統hosts檔案中記錄的資訊
[root@node1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               node1 localhost.localdomain localhost
# ::1           localhost6.localdomain6 localhost6

192.168.100.101 node1
192.168.100.102 node2
192.168.100.201 node1-vip
192.168.100.202 node2-vip
10.10.17.221 node1-priv
10.10.17.222 node2-priv

(2)ping主機名node1
[root@node1 ~]# ping node1
PING node1 (127.0.0.1) 56(84) bytes of data.
64 bytes from node1 (127.0.0.1): icmp_seq=1 ttl=64 time=1.53 ms
64 bytes from node1 (127.0.0.1): icmp_seq=2 ttl=64 time=0.055 ms

問題出現,此處node1顯示的IP地址是127.0.0.1!

(3)分別測試192.168.100.101、192.168.100.102和node2
[root@node1 ~]# ping 192.168.100.101
PING 192.168.100.101 (192.168.100.101) 56(84) bytes of data.
64 bytes from 192.168.100.101: icmp_seq=1 ttl=64 time=2.24 ms
64 bytes from 192.168.100.101: icmp_seq=2 ttl=64 time=0.083 ms

[root@node1 ~]# ping node2
PING node2 (192.168.100.102) 56(84) bytes of data.
64 bytes from node2 (192.168.100.102): icmp_seq=1 ttl=64 time=5.06 ms
64 bytes from node2 (192.168.100.102): icmp_seq=2 ttl=64 time=0.561 ms

[root@node1 ~]# ping 192.168.100.102
PING 192.168.100.102 (192.168.100.102) 56(84) bytes of data.
64 bytes from 192.168.100.102: icmp_seq=1 ttl=64 time=9.55 ms
64 bytes from 192.168.100.102: icmp_seq=2 ttl=64 time=0.819 ms

顯示資訊正確。

2)RAC第二節點演示記錄資訊
(1)系統hosts檔案中記錄的資訊
[root@node2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               node1 localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

192.168.100.101 node1
192.168.100.102 node2
192.168.100.201 node1-vip
192.168.100.202 node2-vip
10.10.17.221 node1-priv
10.10.17.222 node2-priv

(2)ping主機名node1
[root@node2 ~]# ping node1
PING node1 (127.0.0.1) 56(84) bytes of data.
64 bytes from node1 (127.0.0.1): icmp_seq=1 ttl=64 time=2.16 ms
64 bytes from node1 (127.0.0.1): icmp_seq=2 ttl=64 time=0.060 ms

問題出現,此處node1顯示的IP地址也是127.0.0.1!

(3)分別測試192.168.100.101、192.168.100.102和node2
[root@node2 ~]# ping 192.168.100.101
PING 192.168.100.101 (192.168.100.101) 56(84) bytes of data.
64 bytes from 192.168.100.101: icmp_seq=1 ttl=64 time=0.983 ms
64 bytes from 192.168.100.101: icmp_seq=2 ttl=64 time=0.501 ms

[root@node2 ~]# ping node2
PING node2 (192.168.100.102) 56(84) bytes of data.
64 bytes from node2 (192.168.100.102): icmp_seq=1 ttl=64 time=0.200 ms
64 bytes from node2 (192.168.100.102): icmp_seq=2 ttl=64 time=0.046 ms

[root@node2 ~]# ping 192.168.100.102
PING 192.168.100.102 (192.168.100.102) 56(84) bytes of data.
64 bytes from 192.168.100.102: icmp_seq=1 ttl=64 time=0.122 ms
64 bytes from 192.168.100.102: icmp_seq=2 ttl=64 time=0.046 ms

問題出現了,為什麼我在使用別名"node1" Ping第一節點時返回(127.0.0.1)這個地址?

2.問題原因
因hosts檔案中環路地址中的node1資訊沒有清除,導致在解析node1名稱的時候出現錯誤。

3.問題處理
問題處理方法很簡單,分別修改每個節點hosts配置檔案,保證環路地址中不包含“node1”資訊。
調整後的hosts檔案內容如下:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

192.168.100.101 node1
192.168.100.102 node2
192.168.100.201 node1-vip
192.168.100.202 node2-vip
10.10.17.221 node1-priv
10.10.17.222 node2-priv

4.小結
不要放過任何蛛絲馬跡,將問題消滅於前期,否則會對後面的操作帶來非常大的潛在風險,得不償失。

Good luck.

secooler
10.10.06

-- The End --

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-675531/,如需轉載,請註明出處,否則將追究法律責任。

相關文章