Oracle 添加多个scan IP

2024年 5月 3日 73.4k 0

在安装 Oracle Rac 时只设置了一个 SCAN IP(192.168.1.201),现需要再增加两个 SCAN IP 地址,分别为:192.168.1.202 和 192.168.1.203。

一、查看现有的 SCAN IP 配置情况
切换到 grid 用户,执行如下命令:

## 查看 scan 的配置信息
[grid@rac1 ~]$ srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.1.201

## 查看 scan 的状态
[grid@rac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac2

## 查看 scan listener
[grid@rac1 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

二、修改所有节点的 /etc/hosts
内容如下:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

#Public Network (eth0)
192.168.1.11 rac1.example.com rac1
192.168.1.12 rac2.example.com rac2

#Private Interconnect (eth1)
10.1.0.11 rac1-priv.example.com rac1-priv
10.1.0.12 rac2-priv.example.com rac2-priv

#Virtual IP
192.168.1.101 rac1-vip.example.com rac1-vip
192.168.1.102 rac2-vip.example.com rac2-vip

#scan IP
192.168.1.201 rac-scan
### 以下两行为新增内容
192.168.1.202 rac-scan
192.168.1.203 rac-scan

三、停止 scan 监听
[grid@rac1 ~]$ srvctl stop scan_listener
1
四、停止 scan
[grid@rac1 ~]$ srvctl stop scan

[grid@rac1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running

五、配置 scan
切换到 root 用户,执行如下命令:

[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin

# 以下命令修改 scan 信息,-n 后面跟 hosts 中的 scan IP 对应的网络名称
[root@rac1 bin]# ./srvctl modify scan -n rac-scan

# 添加 scanIP 的监听,根据 scan IP 的数量自动增加 listener_scan2、listener_scan3
[root@rac1 bin]# ./srvctl modify scan_listener -u

六、启动 scan
切换到 grid 用户,执行如下命令:

[grid@rac1 ~]$ srvctl start scan

七、启动 scan 监听
执行如下命令:

[grid@rac1 ~]$ srvctl start scan_listener

八、查看 SCAN IP 配置情况
[grid@rac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac2
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node rac1
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node rac1

[grid@rac1 ~]$ srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.1.201
SCAN VIP name: scan2, IP: /rac-scan/192.168.1.202
SCAN VIP name: scan3, IP: /rac-scan/192.168.1.203

[grid@rac1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node rac2
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node rac1
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node rac1

九、查看网络
节点1:

[root@rac1 named]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:C8:E8:4A
inet addr:192.168.1.11 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec8:e84a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10901 errors:0 dropped:0 overruns:0 frame:0
TX packets:10077 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:977018 (954.1 KiB) TX bytes:8188507 (7.8 MiB)

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:C8:E8:4A
inet addr:192.168.1.202 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:C8:E8:4A
inet addr:192.168.1.203 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth0:3 Link encap:Ethernet HWaddr 00:0C:29:C8:E8:4A
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth1 Link encap:Ethernet HWaddr 00:0C:29:C8:E8:54
inet addr:10.1.0.11 Bcast:10.1.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec8:e854/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:427089 errors:0 dropped:0 overruns:0 frame:0
TX packets:397397 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:272384822 (259.7 MiB) TX bytes:231027214 (220.3 MiB)
Interrupt:16 Base address:0x2400

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:C8:E8:54
inet addr:169.254.44.235 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16 Base address:0x2400

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:115634 errors:0 dropped:0 overruns:0 frame:0
TX packets:115634 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:74243172 (70.8 MiB) TX bytes:74243172 (70.8 MiB)

节点2:

[root@rac2 bin]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:1C:2C:99
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1c:2c99/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5319 errors:0 dropped:0 overruns:0 frame:0
TX packets:3499 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:547076 (534.2 KiB) TX bytes:349451 (341.2 KiB)

eth0:1 Link encap:Ethernet HWaddr 00:0C:29:1C:2C:99
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth0:2 Link encap:Ethernet HWaddr 00:0C:29:1C:2C:99
inet addr:192.168.1.201 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

eth1 Link encap:Ethernet HWaddr 00:0C:29:1C:2C:A3
inet addr:10.1.0.12 Bcast:10.1.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1c:2ca3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:400048 errors:1 dropped:1 overruns:0 frame:0
TX packets:426859 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:233445938 (222.6 MiB) TX bytes:271188704 (258.6 MiB)
Interrupt:16 Base address:0x2400

eth1:1 Link encap:Ethernet HWaddr 00:0C:29:1C:2C:A3
inet addr:169.254.12.247 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:16 Base address:0x2400

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:69836 errors:0 dropped:0 overruns:0 frame:0
TX packets:69836 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:38252161 (36.4 MiB) TX bytes:38252161 (36.4 MiB)

相关文章

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

发布评论