一 环境说明
1.1 目前配置说明
节点配置:
别名 |
类型 |
IP地址 |
网卡名 |
hostname1 |
一节点公网IP |
10.0.18.8 |
Bond0 |
hostname2 |
二节点公网IP |
10.0.18.9 |
Bond0 |
hostname1-priv |
一节点心跳IP |
195.195.195.1 |
Bond1 |
hostname2-priv |
二节点心跳IP |
195.195.195.2 |
Bond1 |
hostname1-vip |
一节点VIP |
10.0.18.10 |
Bond0 |
hostname2-vip |
二节点VIP |
10.0.18.11 |
Bond0 |
hostname-scan |
集群scanIP |
10.0.18.12 |
Bond0 |
计划修改后配置:
别名 |
类型 |
IP地址 |
网卡名 |
hostname1 |
一节点公网IP |
10.0.105.3 |
Bond0 |
hostname2 |
二节点公网IP |
10.0.105.4 |
Bond0 |
hostname1-priv |
一节点心跳IP |
195.195.195.1 |
Bond1(不变) |
hostname2-priv |
二节点心跳IP |
195.195.195.2 |
Bond1(不变) |
hostname1-vip |
一节点VIP |
10.0.105.5 |
Bond0 |
hostname2-vip |
二节点VIP |
10.0.105.6 |
Bond0 |
hostname-scan |
集群scanIP |
10.0.105.7 |
Bond0 |
1.2具体说明
本次修改涉及所有的公网网段的IP修改,有原先的10.0.18.0网段迁移到10.0.105.0网段
二 修改步骤
2.1停止双节点服务
停止两边节点数据库,监听,并且停止 crs:
srvctl stop database -d XXXX
srvctl stop asm -n hostname1
srvctl stop asm -n hostname2
srvctl stop nodeapps -n hostname2
srvctl stop nodeapps -n hostname2
双节点关停集群:
#crsctl stop crs
确认集群完全停止
2.2修改双节点/etc/hosts文件
修改前:
10.0.18.8 hostname1
10.0.18.9 hostname1
10.0.18.10 hostname1-vip
10.0.18.11 hostname2-vip
10.0.18.12 hostname-scan
修改后:
10.0.105.3 hostname1
10.0.105.4 hostname2
10.0.105.5 hostname1-vip
10.0.105.6 hostname2-vip
10.0.105.7 hostname-scan
2.3public IP修改
root用户修改bond0文件:
#cd /etc/sysconfig/network-scripts/
#vi ifcfg-bond0
DEVICE=bond0
NM_CONTROLLED=no
ONBOOT=yes
IPADDR=10.0.105.3
BOOTPROTO=static
NETMASK=255.255.255.0
GATEWAY=10.0.105.254
DNS1=10.0.8.3(该DNS需确认是否要修改)
IPV6INIT=no
USERCTL=no
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
NAME="System bond0"
二节点一样修改:
将10.0.18.9改成10.0.105.4
重启双节点网络服务:
#service network restart
双节点启动CRS,修改共享盘中信息:(该操作在一个节点上完成)
grid用户切换到root用户(带环境变量)
#启动双节点CRS:
#crsctl start crs
Root用户修改共享盘网络配置:
#oifcfg getif
bond0 10.0.18.0 global public
bond1 195.195.195.0 global cluster_interconnect
修改
#查看当前配置:
#oifcfg iflist
bond0 10.0.105.0
bond1 195.195.195.0
删除并添加
#oifcfg delif -global bond0
#oifcfg setif -global bond0/10.0.105.0:public
双节点确认:
./oifcfg getif
bond0 10.0.105.0 global public
bond1 195.195.195.0 global cluster_interconnect
2.4修改VIP
关闭数据库:srvctl stop database -d XXXX
检查vip配置:(类似以下输出)
$ srvctl config vip -n zclcrac1
VIP exists.: zclcrac1
VIP exists.: / hostname1-vip/10.0.18.10/255.255.255.0/bond0
$ srvctl config vip -n hostname2
VIP exists.: hostname2
VIP exists.: / hostname2-vip/10.0.18.11/255.255.255.0/bond0
停止 vip 服务和修改 vip
$srvctl stop listener -n hostname1
$srvctl stop listener -n hostname?2
$srvctl stop vip -n hostname1
$srvctl stop vip -n hostname2
#srvctl modify nodeapps -n hostname1 -A 10.0.105.5/255.255.255.0/bond0
#srvctl modify nodeapps -n hostname2 -A 10.0.105.6/255.255.255.0/bond0
确认是否修改成功:
srvctl config vip -n hostname1
srvctl config vip -n hostname2
启动 vip 服务,监听,数据库
srvctl start vip -n hostname1
srvctl start vip -n hostname2
srvctl start listener -n hostname1
srvctl start listener -n hostname2
srvctl start database –d XXXX
双节点修改local_listener 参数:
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.105.5)(PORT=1521))))' scope=both sid='kobra1';
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.105.6)(PORT=1521))))' scope=both sid='kobra2';
2.5修改SCAN IP
srvctl config scan 查看当前 vip 设置
#./srvctl config scan
SCAN name: hostname-scan, Network: 1/10.0.18.0/255.255.255.0/bond0
SCAN VIP name: scan1, IP: /scan-vip/10.0.18.12
停止 scan_listener 和 sacn vip:
$srvctl stop scan_listener
$srvctl stop scan
$srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
$srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
用 root 用户修改 scan vip
#srvctl modify scan –n hostname-scan
检查scanip修改:
srvctl config scan
启动 scan 和 scan_listener
srvctl start scan
srvctl start scan_listener