Chinaunix首页 | 论坛 | 博客
  • 博客访问: 496847
  • 博文数量: 161
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1947
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-25 01:20
文章分类

全部博文(161)

文章存档

2011年(44)

2010年(47)

2009年(48)

2008年(22)

我的朋友

分类: Oracle

2010-12-27 15:50:29

                      Oracle 10g RAC 更改IP地址。(非同网段)

1>更改node1node2

编辑/etc/hosts

# (必须要这样)
127.0.0.1 localhost
#public eth0,eth0 必须指定public ,nat
192.168.41.129 node1
192.168.41.130 node2
#pri eth1
192.168.30.135 node1-priv
192.168.30.136 node2-priv
#vip
192.168.41.140 node1-vip
192.168.41.141 node2-vip
#两个节点要一样,将公网放前,eth0


2>修改静态ip

#node1
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:E0:C2:DE
ONBOOT=yes
DHCP_HOSTNAME=node1
IPADDR=192.168.41.129
NETMASK=255.255.255.0
GATEWAY=192.168.41.2
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:e0:c2:e8
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.30.135
GATEWAY=192.168.30.2
USERCTL=no
IPV6INIT=no
PEERDNS=yes

#Node2上
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:2c:8b:07
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.41.130
GATEWAY=192.168.41.2

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:2c:8b:11
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.30.136
GATEWAY=192.168.30.2


3>停止服务

[root@node1 bin]# ./srvctl stop database -d node

[root@node1 bin]# ./srvctl stop asm -n node1
[root@node1 bin]# ./srvctl stop asm -n node2

[root@node1 bin]# ./srvctl stop nodeapps -n node1
[root@node1 bin]# ./srvctl stop nodeapps -n node2


4>oifcfg修改网卡信息,在其中一个节点上/etc/init.d/init.crs start


--显示原来的信息
[oracle@node1 bin]$ oifcfg getif
eth0 192.168.19.129 global public
eth0 192.168.19.130 global public
eth0 192.168.19.0 global public
eth1 192.168.86.135 global cluster_interconnect
eth1 192.168.86.136 global cluster_interconnect
eth1 192.168.86.0 global cluster_interconnect


--删除
[oracle@node1 bin]$ oifcfg delif -global eth0

[oracle@node1 bin]$ oifcfg delif -global eth1



--添加
[oracle@node1 bin]$ oifcfg setif -global eth0/192.168.41.0:public
[oracle@node1 bin]$ oifcfg setif -global eth0/192.168.41.129:public
[oracle@node1 bin]$ oifcfg setif -global eth0/192.168.41.130:public


--show
[oracle@node1 bin]$ oifcfg getif
eth0 192.168.41.0 global public
eth0 192.168.41.129 global public
eth0 192.168.41.130 global public
eth1 192.168.86.135 global cluster_interconnect
eth1 192.168.86.136 global cluster_interconnect
eth1 192.168.86.0 global cluster_interconnect


--同理处理eth1
[oracle@node1 bin]$ oifcfg setif -global eth1/192.168.30.135:cluster_interconnect
[oracle@node1 bin]$ oifcfg setif -global eth1/192.168.30.136:cluster_interconnect
[oracle@node1 bin]$ oifcfg setif -global eth1/192.168.30.0:cluster_interconnect
[oracle@node1 bin]$ oifcfg getif
eth0 192.168.41.0 global public
eth0 192.168.41.129 global public
eth0 192.168.41.130 global public
eth1 192.168.30.135 global cluster_interconnect
eth1 192.168.30.136 global cluster_interconnect
eth1 192.168.30.0 global cluster_interconnect


--修改vip
[root@node1 bin]#./srvctl modify nodeapps -n node1 -A 192.168.41.140/255.255.255.0/eth0

[root@node1 bin]#./srvctl modify nodeapps -n node2 -A 192.168.41.141/255.255.255.0/eth0


--查看当前vip
[oracle@node2 bin]$ srvctl config nodeapps -n node1 -a
VIP exists.: /node1-vip/192.168.41.140/255.255.255.0/eth0


[oracle@node2 bin]$ srvctl config nodeapps -n node2 -a
VIP exists.: /node2-vip/192.168.41.141/255.255.255.0/eth0


5>检查listener.oratnsname.ora修改listener.ora


Node1上
LISTENER_NODE1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST =
192.168.41.129)(PORT = 1521)(IP = FIRST))
    )
  )
Node2上
LISTENER_NODE2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.41.130)(PORT = 1521)(IP = FIRST))
    )
  )


6>验证

[oracle@node1 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....E1.inst application 0/5 0/0 ONLINE ONLINE node1
ora....E2.inst application 0/5 0/0 ONLINE ONLINE node2
ora.NODE.db application 0/1 0/1 ONLINE ONLINE node2
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE node1
ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE node1
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE node2
ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE node2
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2 


--检查ip,vip

[oracle@node1 ~]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E0:C2:DE
          inet addr:192.168.41.129 Bcast:192.168.41.255 Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee0:c2de/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:1803 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1766 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:152331 (148.7 KiB) TX bytes:188514 (184.0 KiB)
          Interrupt:185 Base address:0x1480
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:E0:C2:DE
          inet addr:192.168.41.140 Bcast:192.168.41.255 Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Interrupt:185 Base address:0x1480
eth1 Link encap:Ethernet HWaddr 00:0C:29:E0:C2:E8
          inet addr:192.168.30.135 Bcast:192.168.30.255 Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee0:c2e8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:20661 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25311 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:13673241 (13.0 MiB) TX bytes:20136208 (19.2 MiB)
          Interrupt:193 Base address:0x1800 


[oracle@node2 ~]$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:2C:8B:07
          inet addr:192.168.41.130 Bcast:192.168.41.255 Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe2c:8b07/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:2314 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2826 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:189485 (185.0 KiB) TX bytes:343790 (335.7 KiB)
          Interrupt:185 Base address:0x1480
eth0:1 Link encap:Ethernet HWaddr 00:0C:29:2C:8B:07
          inet addr:192.168.41.141 Bcast:192.168.41.255 Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Interrupt:185 Base address:0x1480
eth1 Link encap:Ethernet HWaddr 00:0C:29:2C:8B:11
          inet addr:192.168.30.136 Bcast:192.168.30.255 Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe2c:8b11/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:25469 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21064 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20169482 (19.2 MiB) TX bytes:13756314 (13.1 MiB)
          Interrupt:193 Base address:0x1800


阅读(1299) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-06-05 01:57:18

大连法律咨询在线 http://www.fabowang.com 大连律师在线咨询 http://www.fabowang.com 大连法律顾问网 http://www.fabowang.com 大连律师咨询 http://www.fabowang.com

chinaunix网友2010-12-30 14:06:34

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com