RAC集群修改SCANIP

2023年 12月 19日 68.8k 0

原因:服务器掉电,重启后集群正常,但是远程连接报错。scanip 正常挂靠在节点 1,但是 1521 端口不通。后续运维确定,该 ip 被其他服务器占用。

解决方式:修改集群scanip

具体操作如下:(修改期间不需要停止crs,asm,db)

1、确认集群正常

2、使用root权限,关闭scan监听,scan服务

[root@orcl1 ~]# cd /u01/app/grid_home/bin/
[root@orcl1 bin]# ./srvctl config scan
SCAN name: scan-ip, Network: 1/172.16.8.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scan-ip/172.16.8.105
[root@orcl1 bin]# ./srvctl stop scan_listener
[root@orcl1 bin]# ./srvctl stop scan
[root@orcl1 bin]# ./srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
[root@orcl1 bin]# ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fa:5c:b8:2d:11:00 brd ff:ff:ff:ff:ff:ff
inet 172.16.8.74/24 brd 172.16.8.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet 172.16.8.76/24 brd 172.16.8.255 scope global secondary eth0:2
valid_lft forever preferred_lft forever
3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fa:c1:0f:4a:af:01 brd ff:ff:ff:ff:ff:ff
inet 172.16.10.236/24 brd 172.16.10.255 scope global noprefixroute eth1
valid_lft forever preferred_lft forever
inet 169.254.173.156/16 brd 169.254.255.255 scope global eth1:1
valid_lft forever preferred_lft forever

3、运维工程提供同网段可用IP,172.16.8.79。修改集群scanip

[root@orcl1 bin]# ./srvctl modify scan -n 172.16.8.79

两个节点修改hosts文件

[root@orcl1 bin]# vim /etc/hosts
[root@orcl2 ~]# cat /etc/hosts
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.8.74 orcl1
172.16.8.76 orcl1-vip
172.16.10.236 orcl1-priv
172.16.8.99 orcl2
172.16.8.101 orcl2-vip
172.16.10.239 orcl2-priv
172.16.8.79 scan-ip

4、使用root权限,启动scan监听,scan服务

[root@orcl1 bin]# ./srvctl start scan
[root@orcl1 bin]# ./srvctl start scan_listener
[root@orcl1 bin]# ./srvctl config scan
SCAN name: 172.16.8.79, Network: 1/172.16.8.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /172.16.8.79/172.16.8.79

需要轮流重启has服务, scan监听并没有注册服务,所以需要重启has服务

5、修改完成,测试远程连接,查看监听状态及scanip挂靠情况

[root@orcl1 bin]# su - oracle
Last login: Thu May 13 23:14:05 EDT 2021 on pts/0

--监听状态
[oracle@orcl1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 16-MAY-2021 23:30:10

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 11-MAY-2021 23:21:04
Uptime 5 days 0 hr. 9 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/orcl1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=orcl1)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
The command completed successfully

--远程连接测试
[oracle@orcl1 ~]$ sqlplus sys/oracle@172.16.8.79:1521/orcl as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun May 16 23:30:27 2021

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 Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

--scanip挂靠情况
[oracle@orcl1 ~]$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fa:5c:b8:2d:11:00 brd ff:ff:ff:ff:ff:ff
inet 172.16.8.74/24 brd 172.16.8.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet 172.16.8.76/24 brd 172.16.8.255 scope global secondary eth0:2
valid_lft forever preferred_lft forever
inet 172.16.8.79/24 brd 172.16.8.255 scope global secondary eth0:1
valid_lft forever preferred_lft forever
3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fa:c1:0f:4a:af:01 brd ff:ff:ff:ff:ff:ff
inet 172.16.10.236/24 brd 172.16.10.255 scope global noprefixroute eth1
valid_lft forever preferred_lft forever
inet 169.254.173.156/16 brd 169.254.255.255 scope global eth1:1
valid_lft forever preferred_lft forever

修改完成

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论