今天同事遇到这样一个事情,安装完成clusterware之后,最后运行完root.sh之后,需要在rac2上运行vipca再次配置,在这一步骤却过不去。一起看了一下这个问题,送报错的log中有比较明显的提示:没有配置网关。
有了这个提示之后,就比较好处理,在linux上配置192.168.79.1为网关,其中192.168.79.1为vmware VMnet1(hostonly)的网卡地址。service network restart之后,再次运行运行vipca,也能运行成功,查看crs_stat看到vip也确实online了,但是就是ping不通vip,为什么?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
[root@rac1 bin]# ./crs_stat -v -t Name Type R/RA F/FT Target State Host ---------------------------------------------------------------------- ora.devdb.db application 0/1 0/1 ONLINE OFFLINE ora....b1.inst application 0/5 0/0 ONLINE OFFLINE ora....b2.inst application 0/5 0/0 ONLINE OFFLINE ora....SM1.asm application 0/5 0/0 ONLINE UNKNOWN rac1 ora....C1.lsnr application 0/5 0/0 ONLINE UNKNOWN rac1 ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1 ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1 ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1 ora....SM2.asm application 0/5 0/0 ONLINE UNKNOWN rac2 ora....C2.lsnr application 0/5 0/0 ONLINE UNKNOWN rac2 ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2 ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2 ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2 [root@rac1 bin]# [root@rac1 bin]# ping rac2-vip PING rac2-vip.oracle.com (192.168.79.26) 56(84) bytes of data. From rac1.oracle.com (192.168.79.15) icmp_seq=1 Destination Host Unreachable From rac1.oracle.com (192.168.79.15) icmp_seq=2 Destination Host Unreachable From rac1.oracle.com (192.168.79.15) icmp_seq=3 Destination Host Unreachable --- rac2-vip.oracle.com ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4001ms , pipe 4 [root@rac1 bin]# [root@rac1 bin]# [root@rac1 bin]# |
检查了一下vip相关的设置,发现确实有点问题,vip网络是配置成192.168.1.的网段,注意看eth0:1的网段:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
[root@rac1 bin]# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.79.15 Bcast:192.168.79.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe9c:ee4f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3677 errors:0 dropped:0 overruns:0 frame:0 TX packets:3688 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:317108 (309.6 KiB) TX bytes:350214 (342.0 KiB) Interrupt:10 Base address:0x20a4 eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:10 Base address:0x20a4 eth1 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:59 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe9c:ee59/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:29480 errors:0 dropped:0 overruns:0 frame:0 TX packets:35281 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:20628586 (19.6 MiB) TX bytes:31021035 (29.5 MiB) Interrupt:5 Base address:0x2424 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:20969 errors:0 dropped:0 overruns:0 frame:0 TX packets:20969 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3709389 (3.5 MiB) TX bytes:3709389 (3.5 MiB) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) [root@rac1 bin]# |
并且我们通过oifcfg看到配置了2个网段的public,在正常情况下,我们只需要一个public和一个cluster_interconnect:
1 2 3 4 5 6 |
[root@rac1 bin]# ./oifcfg getif eth0 192.168.1.0 global public eth0 192.168.79.0 global public eth1 10.0.0.0 global cluster_interconnect [root@rac1 bin]# [root@rac1 bin]# |
问了一下之前的情况,原来同事在家里是用桥接(bridged)的网络设置虚拟机的网卡地址,地址设置的IP地址为192.168.1网段,并且当时没设置网关。
查到这里,问题就比较好办了。
1.取消oifcfg中的关于192.168.1网段:
1 |
[root@rac1 bin]# ./oifcfg delif -global eth0/192.168.1.0 |
检查一下结果:
1 2 3 4 |
[root@rac1 bin]# ./oifcfg getif eth0 192.168.79.0 global public eth1 10.0.0.0 global cluster_interconnect [root@rac1 bin]# |
2.这里介绍2中修改vip地址的方法,rac1我用方法a修改,rac2我用方法b修改:
a)用srvctl修改vip地址
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
[root@rac1 bin]# ./srvctl modify nodeapps -n rac1 -A 192.168.79.25/255.255.255.0/eth0 [root@rac1 bin]# [root@rac1 bin]# ./crs_stat -p ora.rac1.vip NAME=ora.rac1.vip TYPE=application ACTION_SCRIPT=/u01/app/oracle/product/10.2.0/crs_1/bin/racgwrap ACTIVE_PLACEMENT=1 AUTO_START=1 CHECK_INTERVAL=60 DESCRIPTION=CRS application for VIP on a node FAILOVER_DELAY=0 FAILURE_INTERVAL=0 FAILURE_THRESHOLD=0 HOSTING_MEMBERS=rac1 OPTIONAL_RESOURCES= PLACEMENT=favored REQUIRED_RESOURCES= RESTART_ATTEMPTS=0 SCRIPT_TIMEOUT=60 START_TIMEOUT=0 STOP_TIMEOUT=0 UPTIME_THRESHOLD=7d USR_ORA_ALERT_NAME= USR_ORA_CHECK_TIMEOUT=0 USR_ORA_CONNECT_STR=/ as sysdba USR_ORA_DEBUG=0 USR_ORA_DISCONNECT=false USR_ORA_FLAGS= USR_ORA_IF=eth0 USR_ORA_INST_NOT_SHUTDOWN= USR_ORA_LANG= USR_ORA_NETMASK=255.255.255.0 USR_ORA_OPEN_MODE= USR_ORA_OPI=false USR_ORA_PFILE= USR_ORA_PRECONNECT=none USR_ORA_SRV= USR_ORA_START_TIMEOUT=0 USR_ORA_STOP_MODE=immediate USR_ORA_STOP_TIMEOUT=0 USR_ORA_VIP=192.168.79.25 [root@rac2 bin]# |
b)用导出crs,编辑crs,再update crs资源的方式:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
## 先导出crs资源中关系rac2的vip信息,注意导出的路径为$ORA_CRS_HOME/crs_1/profile下,名称为<资源名>.cap: [root@rac2 bin]# ./crs_stat -p ora.rac2.vip > /u01/app/oracle/product/10.2.0/crs_1/crs/profile/ora.rac2.vip.cap ##修改该文件,将vip的地址改掉 [root@rac2 tmp]# cat /u01/app/oracle/product/10.2.0/crs_1/crs/profile/ora.rac2.vip.cap NAME=ora.rac2.vip TYPE=application ACTION_SCRIPT=/u01/app/oracle/product/10.2.0/crs_1/bin/racgwrap ACTIVE_PLACEMENT=1 AUTO_START=1 CHECK_INTERVAL=60 DESCRIPTION=CRS application for VIP on a node FAILOVER_DELAY=0 FAILURE_INTERVAL=0 FAILURE_THRESHOLD=0 HOSTING_MEMBERS=rac2 OPTIONAL_RESOURCES= PLACEMENT=favored REQUIRED_RESOURCES= RESTART_ATTEMPTS=0 SCRIPT_TIMEOUT=60 START_TIMEOUT=0 STOP_TIMEOUT=0 UPTIME_THRESHOLD=7d USR_ORA_ALERT_NAME= USR_ORA_CHECK_TIMEOUT=0 USR_ORA_CONNECT_STR=/ as sysdba USR_ORA_DEBUG=0 USR_ORA_DISCONNECT=false USR_ORA_FLAGS= USR_ORA_IF=eth0 USR_ORA_INST_NOT_SHUTDOWN= USR_ORA_LANG= USR_ORA_NETMASK=255.255.255.0 USR_ORA_OPEN_MODE= USR_ORA_OPI=false USR_ORA_PFILE= USR_ORA_PRECONNECT=none USR_ORA_SRV= USR_ORA_START_TIMEOUT=0 USR_ORA_STOP_MODE=immediate USR_ORA_STOP_TIMEOUT=0 USR_ORA_VIP=192.168.79.26 [root@rac2 bin]# ./crs_register -u ora.rac2.vip [root@rac2 bin]# [root@rac2 bin]# [root@rac2 bin]# [root@rac2 bin]# ./crs_stat -p ora.rac2.vip NAME=ora.rac2.vip TYPE=application ACTION_SCRIPT=/u01/app/oracle/product/10.2.0/crs_1/bin/racgwrap ACTIVE_PLACEMENT=1 AUTO_START=1 CHECK_INTERVAL=60 DESCRIPTION=CRS application for VIP on a node FAILOVER_DELAY=0 FAILURE_INTERVAL=0 FAILURE_THRESHOLD=0 HOSTING_MEMBERS=rac2 OPTIONAL_RESOURCES= PLACEMENT=favored REQUIRED_RESOURCES= RESTART_ATTEMPTS=0 SCRIPT_TIMEOUT=60 START_TIMEOUT=0 STOP_TIMEOUT=0 UPTIME_THRESHOLD=7d USR_ORA_ALERT_NAME= USR_ORA_CHECK_TIMEOUT=0 USR_ORA_CONNECT_STR=/ as sysdba USR_ORA_DEBUG=0 USR_ORA_DISCONNECT=false USR_ORA_FLAGS= USR_ORA_IF=eth0 USR_ORA_INST_NOT_SHUTDOWN= USR_ORA_LANG= USR_ORA_NETMASK=255.255.255.0 USR_ORA_OPEN_MODE= USR_ORA_OPI=false USR_ORA_PFILE= USR_ORA_PRECONNECT=none USR_ORA_SRV= USR_ORA_START_TIMEOUT=0 USR_ORA_STOP_MODE=immediate USR_ORA_STOP_TIMEOUT=0 USR_ORA_VIP=192.168.1.106 ## <--修改此处为192.168.79.26 [root@rac2 bin]# ##修改完成之后,更新crs: [root@rac2 bin]# ./crs_register -u ora.rac2.vip [root@rac2 bin]# [root@rac2 bin]# [root@rac2 bin]# ## 检查vip的是否修改完成: [root@rac2 bin]# ./crs_stat -p ora.rac2.vip NAME=ora.rac2.vip TYPE=application ACTION_SCRIPT=/u01/app/oracle/product/10.2.0/crs_1/bin/racgwrap ACTIVE_PLACEMENT=1 AUTO_START=1 CHECK_INTERVAL=60 DESCRIPTION=CRS application for VIP on a node FAILOVER_DELAY=0 FAILURE_INTERVAL=0 FAILURE_THRESHOLD=0 HOSTING_MEMBERS=rac2 OPTIONAL_RESOURCES= PLACEMENT=favored REQUIRED_RESOURCES= RESTART_ATTEMPTS=0 SCRIPT_TIMEOUT=60 START_TIMEOUT=0 STOP_TIMEOUT=0 UPTIME_THRESHOLD=7d USR_ORA_ALERT_NAME= USR_ORA_CHECK_TIMEOUT=0 USR_ORA_CONNECT_STR=/ as sysdba USR_ORA_DEBUG=0 USR_ORA_DISCONNECT=false USR_ORA_FLAGS= USR_ORA_IF=eth0 USR_ORA_INST_NOT_SHUTDOWN= USR_ORA_LANG= USR_ORA_NETMASK=255.255.255.0 USR_ORA_OPEN_MODE= USR_ORA_OPI=false USR_ORA_PFILE= USR_ORA_PRECONNECT=none USR_ORA_SRV= USR_ORA_START_TIMEOUT=0 USR_ORA_STOP_MODE=immediate USR_ORA_STOP_TIMEOUT=0 USR_ORA_VIP=192.168.79.26 [root@rac2 bin]# [root@rac2 bin]# |
3.重启crs服务:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@rac1 bin]# /etc/init.d/init.crs stop Shutting down Oracle Cluster Ready Services (CRS): Stopping resources. Successfully stopped CRS resources Stopping CSSD. Shutting down CSS daemon. Shutdown request successfully issued. Shutdown has begun. The daemons should exit soon. [root@rac1 bin]# [root@rac1 bin]# [root@rac1 bin]# [root@rac1 bin]# /etc/init.d/init.crs start Startup will be queued to init within 90 seconds. [root@rac1 bin]# [root@rac1 bin]# |
4.检查网络:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
[root@rac1 bin]# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.79.15 Bcast:192.168.79.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe9c:ee4f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4926 errors:0 dropped:0 overruns:0 frame:0 TX packets:4894 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:423166 (413.2 KiB) TX bytes:458330 (447.5 KiB) Interrupt:10 Base address:0x20a4 eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.1.105 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:10 Base address:0x20a4 eth0:2 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.79.25 Bcast:192.168.190.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:10 Base address:0x20a4 eth1 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:59 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe9c:ee59/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:39931 errors:0 dropped:0 overruns:0 frame:0 TX packets:42423 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:31121904 (29.6 MiB) TX bytes:37055997 (35.3 MiB) Interrupt:5 Base address:0x2424 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:25976 errors:0 dropped:0 overruns:0 frame:0 TX packets:25976 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3862680 (3.6 MiB) TX bytes:3862680 (3.6 MiB) sit0 Link encap:IPv6-in-IPv4 NOARP MTU:1480 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) [root@rac1 bin]# |
此时已经可以ping vip了:
1 2 3 4 5 6 7 8 9 10 |
[root@rac1 bin]# ping rac2-vip PING rac2-vip.oracle.com (192.168.79.26) 56(84) bytes of data. 64 bytes from rac2-vip.oracle.com (192.168.79.26): icmp_seq=0 ttl=64 time=0.921 ms 64 bytes from rac2-vip.oracle.com (192.168.79.26): icmp_seq=1 ttl=64 time=1.19 ms 64 bytes from rac2-vip.oracle.com (192.168.79.26): icmp_seq=2 ttl=64 time=0.000 ms --- rac2-vip.oracle.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/avg/max/mdev = 0.000/0.706/1.198/0.512 ms, pipe 2 [root@rac1 bin]# |
另外,由于eth0上出现了2个绑定的IP,如果你如果和我一样有洁癖,可以用ifconfig再改一下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[root@rac1 ~]# ifconfig eth0:1 down [root@rac1 ~]# ifconfig eth0:2 down [root@rac1 ~]# ifconfig eth0:1 192.168.79.25 netmask 255.255.255.0 up [root@rac1 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.79.15 Bcast:192.168.79.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe9c:ee4f/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1709 errors:0 dropped:0 overruns:0 frame:0 TX packets:1800 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:144931 (141.5 KiB) TX bytes:154502 (150.8 KiB) Interrupt:10 Base address:0x20a4 eth0:1 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:4F inet addr:192.168.79.25 Bcast:192.168.79.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:10 Base address:0x20a4 eth1 Link encap:Ethernet HWaddr 00:0C:29:9C:EE:59 inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe9c:ee59/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:58831 errors:0 dropped:0 overruns:0 frame:0 TX packets:46188 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:58311355 (55.6 MiB) TX bytes:40821202 (38.9 MiB) Interrupt:5 Base address:0x2424 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:25831 errors:0 dropped:0 overruns:0 frame:0 TX packets:25831 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4026775 (3.8 MiB) TX bytes:4026775 (3.8 MiB) [root@rac1 ~]# |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
[root@rac2 bin]# ifconfig eth0:1 down [root@rac2 bin]# ifconfig eth0:2 down [root@rac2 bin]# ifconfig eth0:1 192.168.79.26 netmask 255.255.255.0 up [root@rac2 bin]# [root@rac2 bin]# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:C4:93:DA inet addr:192.168.79.16 Bcast:192.168.79.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fec4:93da/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4573 errors:0 dropped:0 overruns:0 frame:0 TX packets:4471 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:382261 (373.3 KiB) TX bytes:414120 (404.4 KiB) Interrupt:10 Base address:0x20a4 eth0:1 Link encap:Ethernet HWaddr 00:0C:29:C4:93:DA inet addr:192.168.79.26 Bcast:192.168.79.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Interrupt:10 Base address:0x20a4 eth1 Link encap:Ethernet HWaddr 00:0C:29:C4:93:E4 inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fec4:93e4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:46132 errors:0 dropped:0 overruns:0 frame:0 TX packets:58460 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:40803518 (38.9 MiB) TX bytes:58269953 (55.5 MiB) Interrupt:5 Base address:0x2424 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:26665 errors:0 dropped:0 overruns:0 frame:0 TX packets:26665 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4014814 (3.8 MiB) TX bytes:4014814 (3.8 MiB) [root@rac2 bin]# |
最后,再次重申一下,安装clusterware的之前,一定要配置好网关。
2条评论
小荷 交换个博客链接 Thanks
http://www.killdb.com