温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么修改linux中rac集群各种ip地址

发布时间:2021-11-05 10:44:02 来源:亿速云 阅读:226 作者:iii 栏目:关系型数据库

这篇文章主要介绍“怎么修改linux中rac集群各种ip地址”,在日常操作中,相信很多人在怎么修改linux中rac集群各种ip地址问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么修改linux中rac集群各种ip地址”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

修改ip地址:
1.查看接口配置并修改:
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg getif
enp0s3 192.168.6.0 global public 公网ip网段
enp0s8 10.10.10.0 global cluster_interconnect 私网ip网段
删除原公有,私有IP地址:
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg delif -global enp0s3
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg delif -global enp0s8
重新设置新Public IP:
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg setif -global enp0s3/192.168.60.0:public
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg setif -global enp0s8/10.10.20.0:cluster_inerconnect
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg getif

2.停止has服务:
/oracle/app/11.2.0/grid/bin/crsctl stop has

3.通过操作系统命令修改公有,私有IP地址
linux: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
systemctl restart network
修改SCAN域名配置(存在DNS域名方式解析,修改域名映射)
修改hosts文件公共IP地址,VIP地址,SCAN地址
vi /etc/hosts

4.启动has:
/oracle/app/11.2.0/grid/bin/crsctl start has

5.查看和修改网络资源
/oracle/app/11.2.0/grid/bin/srvctl config network
Network exists: 1/192.168.6.0/255.255.255.0/enp0s3, type static

/oracle/app/11.2.0/grid/bin/srvctl modify network -k 1 -S 192.168.60.0/255.255.255.0/enp0s3 -v

6.重新配置SCAN VIP和SCAN Listener
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.6.0/255.255.255.0/enp0s3
SCAN VIP name: scan1, IP: /rac-scan/192.168.6.254

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl stop scan_listener
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl stop scan
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl remove scan_listener
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl remove scan

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl add scan -n scan(新的scan名称) -k 1 -S 192.168.60.0/255.255.255.0/enp0s3
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl add scan_listener
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start scan
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start scan_listener

7.重新配置vip
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config vip -n rac1
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config vip -n rac2
VIP exists: /rac1-vip/192.168.6.102/192.168.6.0/255.255.255.0/enp0s3, hosting node rac1

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl stop resource ora.rac1.vip -f
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl stop resource ora.rac2.vip -f

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl modify nodeapps -A 192.168.60.101/255.255.255.0/enp0s3 -n rac1
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl modify nodeapps -A 192.168.60.201/255.255.255.0/enp0s3 -n rac2

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl start resource ora.rac1.vip -f
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl start resource ora.rac2.vip -f

ps:–crsctl eval stop resource ora.cdbrac.db -unsupported(划重点12c的变化,eval是模拟命令)Doc ID 1966448.1

8.启动本地监听
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start listener -n rac1
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start listener -n rac2

9.修改数据库实例参数
alter system set local_listener=’(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.60.101)(PORT=1521))))’ scope=both sid=‘prod1’;
alter system set local_listener=’(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.60.201)(PORT=1521))))’ scope=both sid=‘prod2’;
alter system register;

10.检查资源状态
ifconfig
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan_listener
gridlrlgridlsnrctl status listener_scan1
grid$crsctl status res –t

到此,关于“怎么修改linux中rac集群各种ip地址”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI