合 Oracle rac不能监听public ip
Tags: Oracle故障处理rac监听remote_listener修改端口号listener.oralocal_listenerSCAN IPPublic IP静态监听
现象
Oracle 11.2.0.4的rac不能监听public ip,很奇怪:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | [root@abrac1 admin]# srvctl stop listener [root@abrac1 admin]# srvctl start listener [root@abrac1 admin]# lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-DEC-2022 16:24:34 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 01-DEC-2022 16:24:29 Uptime 0 days 0 hr. 0 min. 5 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/11.2.0.4/grid/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/abrac1/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.30.7.83)(PORT=1522))) Services Summary... Service "abclogy" has 1 instance(s). Instance "abclogy1", status READY, has 1 handler(s) for this service... Service "abclogyXDB" has 1 instance(s). Instance "abclogy1", status READY, has 1 handler(s) for this service... The command completed successfully [root@abrac1 admin]# ll total 32 -rw-r--r-- 1 grid oinstall 182 Dec 1 16:24 endpoints_listener.ora -rw-r--r-- 1 grid oinstall 171 Dec 1 16:24 endpoints_listener.ora.bak.abrac1 -rw-r--r-- 1 grid oinstall 184 Nov 24 19:22 listener2211247PM2235.bak -rw-r--r-- 1 grid oinstall 350 Nov 24 19:22 listener.ora -rw-r--r-- 1 grid oinstall 184 Nov 24 19:10 listener.ora.bak.abrac1 drwxr-xr-x 2 grid oinstall 4096 Nov 24 18:58 samples -rw-r--r-- 1 grid oinstall 381 Dec 17 2012 shrept.lst -rw-r--r-- 1 grid oinstall 218 Nov 24 19:22 sqlnet.ora [root@abrac1 admin]# more endpoints_listener.ora LISTENER_abRAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=abrac1-vip)(PORT=1522))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1522)(IP=FIRST)))) # line added by Agent [root@abrac1 admin]# [oracle@abrac1 ~]$ sas SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 1 16:27:32 2022 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> show parameter local NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ local_listener string (DESCRIPTION=(ADDRESS=(PROTOCO L=tcp)(HOST=172.30.7.83)(PORT= 1522))), (DESCRIPTION=(ADDRESS =(PROTOCOL=tcp)(HOST=172.30.7. 81)(PORT=1522))) log_archive_local_first boolean TRUE parallel_force_local boolean FALSE |
解决
修改监听文件/u01/app/11.2.0.4/grid/network/admin/listener.ora
文件,增加如下内容:
1 2 3 4 5 6 7 | LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.30.7.81)(PORT = 1522)) (ADDRESS = (PROTOCOL = TCP)(HOST = 172.30.7.83)(PORT = 1522)) ) ) |
查看:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | [root@abrac1 admin]# cat endpoints_listener.ora LISTENER_OARAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=abrac1-vip)(PORT=1522))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1522)(IP=FIRST)))) # line added by Agent [root@oarac1 admin]# cat listener.ora LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.30.7.81)(PORT = 1522)) (ADDRESS = (PROTOCOL = TCP)(HOST = 172.30.7.83)(PORT = 1522)) ) ) [root@abrac1 admin]# pwd /u01/app/11.2.0.4/grid/network/admin [root@abrac1 admin]# |
然后重启监听即可:
1 2 3 4 5 6 7 8 9 | srvctl stop listener srvctl start listener -- 检查 tnsping 172.30.7.81:1522/abclogy tnsping 172.30.7.82:1522/abclogy tnsping 172.30.7.83:1522/abclogy tnsping 172.30.7.84:1522/abclogy tnsping 172.30.7.85:1522/abclogy |
结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | [root@abrac1 admin]# lsnrctl status LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 01-DEC-2022 16:59:18 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.30.7.82)(PORT=1522))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 01-DEC-2022 16:56:23 Uptime 0 days 0 hr. 2 min. 55 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/11.2.0.4/grid/network/admin/listener.ora Listener Log File /u01/app/grid/diag/tnslsnr/oarac2/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.30.7.81)(PORT=1522))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.30.7.83)(PORT=1522))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522))) Services Summary... Service "abclogy" has 1 instance(s). Instance "abclogy2", status READY, has 1 handler(s) for this service... Service "abclogyXDB" has 1 instance(s). Instance "abclogy2", status READY, has 1 handler(s) for this service... The command completed successfully [root@abrac1 admin]# cat /etc/hosts ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 localhost abrac2 localhost.localdomain localhost4 localhost4.localdomain4 172.30.7.81 abrac1 172.30.7.82 abrac2 172.30.7.83 abrac1-vip 172.30.7.84 abrac2-vip 1.1.4.1 abrac1-priv 1.1.4.2 abrac2-priv 172.30.7.85 abrac-scan [root@abrac1 admin]# |
可见,public和vip都已经被监听了。
其它原因 (Doc ID 1597716.1)
文件/etc/nsswitch.conf
的权限问题:
1 | chmod 666 /etc/nsswitch.conf |
日志文件:/u01/app/11.2.0.4/grid/log/oarac2/agent/crsd/oraagent_grid/oraagent_grid.log
文件endpoints_listener.ora
不能直接修改,因为重启监听又回到最初的状态了。
Public IP Endpoint is not registered for Listener in 11.2 RAC (Doc ID 1597716.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.2.0.1 to 11.2.0.4 [Release 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Generic (Platform Independent)
SYMPTOMS
This is two node RAC, ONS fails to start, listener starts successful, but Public IP ENDPOINT is not dynamically registered to the Listener.
- lsnrctl status shows only VIP Endpoint registered, Public IP Endpoint not registered.
$ lsnrctl status