Chinaunix首页 | 论坛 | 博客
  • 博客访问: 567007
  • 博文数量: 287
  • 博客积分: 27
  • 博客等级: 民兵
  • 技术积分: 547
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-01 20:20
文章分类

全部博文(287)

文章存档

2015年(1)

2014年(95)

2013年(90)

2012年(101)

分类: Oracle

2014-03-13 17:31:03

原文地址:10g下修改public ip和virtual ip 作者:hxl

环境:
OS:Linux As 5
DB:10.2.0.5

  机房搬迁或是网络重新规划的时候,这个时候我们就需要修改节点的ip地址,下面说明如何修改两个节点的ip地址.

1.修改ip规划

public地址修改
192.168.1.106   node1   node1
192.168.1.107   node2   node2
计划修改为
192.168.1.116   node1   node1
192.168.1.117   node2   node2

vip地址修改
192.168.1.116   node1-vip       node1-vip
192.168.1.117   node2-vip       node2-vip
计划修改为
192.168.1.216   node1-vip       node1-vip
192.168.1.217   node2-vip       node2-vip

2.修改网卡i地址
[root@node1 network-scripts]# vi ifcfg-eth0

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:1F:C3:06
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.1.116
GATEWAY=192.168.1.1
USERCTL=no
IPV6INIT=no
PEERDNS=yes


[root@node2 network-scripts]# vi ifcfg-eth0

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
HWADDR=00:0c:29:d1:b1:2b
NETMASK=255.255.255.0
IPADDR=192.168.1.117
GATEWAY=192.168.1.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=no

3.修改hosts文件
[root@node1 /]# vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost

#Public
#Private
#Virtual
192.168.1.116   node1   node1
192.168.1.117   node2   node2
10.10.10.1      node1-priv      node1-priv
10.10.10.2      node2-priv      node2-priv
192.168.1.216   node1-vip       node1-vip
192.168.1.217   node2-vip       node2-vip

[root@node2 /]# vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost

#Public
#Private
#Virtual
192.168.1.116   node1   node1
192.168.1.117   node2   node2
10.10.10.1      node1-priv      node1-priv
10.10.10.2      node2-priv      node2-priv
192.168.1.216   node1-vip       node1-vip
192.168.1.217   node2-vip       node2-vip

4.重启网路
分别在两个节点上重启网路

5.修改两个节点的监听器
node1-> vi listener.ora

# listener.ora.node1 Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.node1
# Generated by Oracle configuration tools.

SID_LIST_LISTENER_NODE1 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
  )

LISTENER_NODE1 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.116)(PORT = 1521)(IP = FIRST))
    )
  )
 
 
node2-> vi listener.ora

# listener.ora.node2 Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.node2
# Generated by Oracle configuration tools.

SID_LIST_LISTENER_NODE2 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
  )

LISTENER_NODE2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521)(IP = FIRST))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.117)(PORT = 1521)(IP = FIRST))
    )
  )
 
6.修改vip地址
节点1
node1-> oifcfg getif
eth0  192.168.1.0  global  public
eth1  10.10.10.0  global  cluster_interconnect
node1-> srvctl modify nodeapps -n node1 -A 192.168.1.116/255.255.255.0/eth0
PRKO-2117 : This command should be executed as the system privilege user.
node1-> su - root
Password:
[root@node1 ~]# /u01/app/oracle/product/10.2.0/crs_1/bin/srvctl modify nodeapps -n node1 -A 192.168.1.216/255.255.255.0/eth0

节点2
node2-> oifcfg getif
eth0  192.168.1.0  global  public
eth1  10.10.10.0  global  cluster_interconnect

[root@node2 ~]# /u01/app/oracle/product/10.2.0/crs_1/bin/srvctl modify nodeapps -n node2 -A 192.168.1.217/255.255.255.0/eth0

7.启动相应的服务
查看是否有没有启动的资源
node1-> crs_stat -t
若是有相关服务没有启动可以使用crs_start启动.

-- The End --

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