本帖最后由 郑全 于 2018-8-24 17:41 编辑
背景:
系统刚建好,老板说,主机名能否修改一下,天,查了一下 metalink,说不能修改主机名,要修改,办法只有一个,删除集群,重建。
改吗,一般不改。
但既然有需求,存在就有合理性。
目标:
把主机名由 host01,host02修改为 rac01,rac02
相关的主机名称都修改。
步骤:
好吧,开干:
1 原来的Hosts文件配置
192.0.3.111 host01.example.com host01
192.0.3.112 host02.example.com host02
10.0.3.101 host01-priv.example.com host01-priv
10.0.3.102 host02-priv.example.com host02-priv
192.0.3.105 host01-vip.example.com host01-vip
192.0.3.106 host02-vip.example.com host02-vip
192.0.3.100 cluster01-scan.example.com cluster01-scan
2. 卸载CRS,在非最后一个节点运行
[root@host01 ~]# /u01/app/11.2.0/grid/crs/install/rootcrs.pl -verbose -deconfig -force
。。。
CRS-2677: Stop of 'ora.gpnpd' on 'host01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'host01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle clusterware stack on this node
3.在最后一个节点卸载 crs
[root@host02 ~]#/u01/app/11.2.0/grid/crs/install/rootcrs.pl -verbose -deconfig -force -lastnode
...
CRS-4611: Successful deletion of voting disk +DATA.
ASM de-configuration trace file location: /tmp/asmcadc_clean2018-08-24_04-12-50-PM.log
ASM Clean Configuration START
ASM Clean Configuration END
ASM with SID +ASM1 deleted successfully. Check /tmp/asmcadc_clean2018-08-24_04-12-50-PM.log for details.
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'host02'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'host02'
CRS-2673: Attempting to stop 'ora.crf' on 'host02'
CRS-2673: Attempting to stop 'ora.ctssd' on 'host02'
CRS-2673: Attempting to stop 'ora.asm' on 'host02'
CRS-2677: Stop of 'ora.mdnsd' on 'host02' succeeded
CRS-2677: Stop of 'ora.crf' on 'host02' succeeded
CRS-2677: Stop of 'ora.asm' on 'host02' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'host02'
CRS-2677: Stop of 'ora.ctssd' on 'host02' succeeded
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'host02' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host02'
CRS-2677: Stop of 'ora.cssd' on 'host02' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'host02'
CRS-2677: Stop of 'ora.gipcd' on 'host02' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'host02'
CRS-2677: Stop of 'ora.gpnpd' on 'host02' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'host02' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle clusterware stack on this node
4. 修改主机名称
[root@host01 ~]# hostname rac01.exampl.com
[root@host02 ~]# hostname rac02.exampl.com
--修改 /etc/sysconfig/network 文件
[root@host01 ~]# vim /etc/sysconfig/network
--修改 hosts文件
vi /etc/hosts
:s/host01/rac01/g
:s/host02/rac02/g
5. 修改11g grid的参数文件(Node1,Node2)
# vim $GRID_HOME/crs/install/crsconfig_params
:%s/host01/rac01/g
:%s/host02/rac02/g
6. 重建grid用户互信
因为主机名修改了,两节点间grid用户信任关系需要重建
[root@host01 ~]# /u01/app/11.2.0/grid/deinstall/sshUserSetup.sh -user oracle -hosts rac01 rac02 -noPromptPassphrase
建立对等后,测试一下 ssh rac01 ,ssh rac02,不输入密码
7. 在各个节点依次运行/u01/app/11.2.0/grid/root.sh脚本
节点1 rac01 运行root.sh
最后在 另外一个节点rac02 运行root.sh
8.asmca命令加载ASM磁盘组
9.grid用户netca注册监听
netca -silent -responsefile /u01/app/11.2.0/grid/assistants/netca/netca.rsp
这个本地监听是没有的,需要手工建立
当然,还有数据库之类的,你可以手工加上去。
10.最后做完,结果如下 :
[oracle@rac01 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ACFS.dg
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.DATA.dg
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.FRA.dg
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.LISTENER.lsnr
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.asm
ONLINE ONLINE rac01 Started
ONLINE ONLINE rac02 Started
ora.gsd
OFFLINE OFFLINE rac01
OFFLINE OFFLINE rac02
ora.net1.network
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.ons
ONLINE ONLINE rac01
ONLINE ONLINE rac02
ora.registry.acfs
ONLINE ONLINE rac01
ONLINE ONLINE rac02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac01
ora.cvu
1 ONLINE ONLINE rac01
ora.oc4j
1 ONLINE ONLINE rac01
ora.rac01.vip
1 ONLINE ONLINE rac01
ora.rac02.vip
1 ONLINE ONLINE rac02
ora.scan1.vip
1 ONLINE ONLINE rac01
|