最新消息: 关于Git&GitHub 版本控制你了解多少?
您现在的位置是:群英 > 开发技术 > 移动开发 >
你知道RAC怎么增加管理IP地址吗?
ITPUB发表于 2021-01-05 17:35 次浏览

今天小编给大家分享一下RAC怎么增加管理IP地址、名称、端口等信息。希望对大家有帮助。
 

你知道RAC怎么增加管理IP地址吗?


在生产实践中,往往需要一个集群的维护IP,这个IP同样需要高可用,如果不与原先公网在一个网段,可以采用今天我们测试的方法为集群增加管理IP,但是这种方式的劣势就是需要分配更多IP地址,而地址得对于任何单位都是稀缺资源,其实也可以在一个网段,我们当时在银行时就采用了在同一个公网网段增加管理IP的方法,如果你需要可以的单独联系我,今天我们测试与原先的公网不在一个网段增加管理IP的方法。

 

增加网络

[root@rac1 grid]# srvctl add network -k 200 -S 3.3.3.0/255.255.255.0/eth2 -w static

 

[root@rac1 grid]# srvctl config network

Network exists: 1/192.168.56.0/255.255.255.0/eth0, type static

Network exists: 200/3.3.3.0/255.255.255.0/eth2, type static

 

增加VIP,这里VIP就是公网IP(具有欺骗性)

之前要修改两个节点的host文件,解析VIP

[root@rac1 grid]# srvctl add vip -n rac1 -A mgr1_vip/255.255.255.0 -k 200

[root@rac1 grid]# srvctl add vip -n rac2 -A mgr2_vip/255.255.255.0 -k 200

 

查看VIP配置

[root@rac1 grid]# srvctl config vip -n rac1

VIP exists: /mgr1_vip/3.3.3.5/3.3.3.0/255.255.255.0/eth2, hosting node rac1

VIP exists: /rac1-vip/192.168.56.111/192.168.56.0/255.255.255.0/eth0, hosting node rac1

[root@rac1 grid]# srvctl config vip -n rac2

VIP exists: /mgr2_vip/3.3.3.6/3.3.3.0/255.255.255.0/eth2, hosting node rac2

VIP exists: /rac2-vip/192.168.56.222/192.168.56.0/255.255.255.0/eth0, hosting node rac2

 

启动VIP

[root@rac1 grid]# srvctl start vip  -i mgr1_vip

[root@rac1 grid]# srvctl start vip  -i mgr2_vip

 

查看VIP状态

[root@rac1 grid]# srvctl status vip -n rac1

VIP mgr1_vip is enabled

VIP mgr1_vip is running on node: rac1

VIP rac1-vip is enabled

VIP rac1-vip is running on node: rac1

[root@rac1 grid]# srvctl status vip -n rac2

VIP mgr2_vip is enabled

VIP mgr2_vip is running on node: rac2

VIP rac2-vip is enabled

VIP rac2-vip is running on node: rac2

 

 

 

通过netca创建监听或srvctl 添加监听

[grid@rac1 ~]$ srvctl add listener -l listener_mgr -p 1523 -k 200 -s

 

检查监听状态,并启动监听

[grid@rac1 ~]$ srvctl status listener -l listener_mgr

Listener LISTENER_MGR is enabled

Listener LISTENER_MGR is not running

 

[grid@rac1 ~]$ srvctl start listener -l listener_mgr

 

[grid@rac1 ~]$ srvctl status listener -l listener_mgr

Listener LISTENER_MGR is enabled

Listener LISTENER_MGR is running on node(s): rac2,rac1

 

5 lsnrctl检查监听状态,看是有服务注册

 

[grid@rac1 ~]$ lsnrctl status listener_mgr;

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_MGR)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_MGR

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Uptime                    0 days 0 hr. 4 min. 25 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/11.2.0/grid/network/admin/listener.ora

Listener Log File         /u01/11.2.0/grid/log/diag/tnslsnr/rac1/listener_mgr/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_MGR)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=3.3.3.5)(PORT=1523)))

The listener supports no services

The command completed successfully

 

修改参数local_listener 

SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.111)(PORT=1521))','(ADDRESS=(PROTOCOL=TCP)(HOST=3.3.3.5)(PORT=1523))' sid='prod1';

SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.222)(PORT=1521))','(ADDRESS=(PROTOCOL=TCP)(HOST=3.3.3.6)(PORT=1523))' sid='prod2' ;

 

两个节点看服务是否注册到新网络的监听

节点1

[grid@rac1 ~]$ lsnrctl status listener_mgr;

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_MGR)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_MGR

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Uptime                    0 days 0 hr. 13 min. 52 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/11.2.0/grid/network/admin/listener.ora

Listener Log File         /u01/11.2.0/grid/log/diag/tnslsnr/rac1/listener_mgr/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_MGR)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=3.3.3.5)(PORT=1523)))

Services Summary...

Service "prod" has 1 instance(s).

  Instance "prod1", status READY, has 1 handler(s) for this service...

The command completed successfully

 

节点2

[grid@rac2 Desktop]$ lsnrctl status listener_mgr;

 

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_MGR)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER_MGR

Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Uptime                    0 days 0 hr. 14 min. 29 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /u01/11.2.0/grid/network/admin/listener.ora

Listener Log File         /u01/11.2.0/grid/log/diag/tnslsnr/rac2/listener_mgr/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_MGR)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=3.3.3.6)(PORT=1523)))

Services Summary...

Service "prod" has 1 instance(s).

  Instance "prod2", status READY, has 1 handler(s) for this service...

The command completed successfully

 

连接测试

节点1通过VIP mgr1_vip连接测试

[oracle@rac1 ~]$ sqlplus system/oracle@mgr1_vip:1523/prod

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Real Application Clusters and Automatic Storage Management options

 

SQL> 

 

节点1通过VIP mgr2_vip连接测试

[oracle@rac1 ~]$ sqlplus system/oracle@mgr2_vip:1523/prod

 

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Real Application Clusters and Automatic Storage Management options

 

SQL> 

 

 

试验测试完毕!

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