当前位置:网站首页>Simulate not all endpoints registered exceptions and Solutions

Simulate not all endpoints registered exceptions and Solutions

2022-07-23 07:54:00 51CTO

database :oracle 11.2.0.4

System :CentOS 7.9

Environmental Science :rac (2 node )

The goal of the experiment : simulation not all endpoints registered abnormal , And providing solutions .

1、 database information

1.1、IP Information

      
      
[[email protected] bin]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.133.160 netmask 255.255.255.0 broadcast 192.168.133.255
inet6 fe80::cb50:11ab:ea13:255c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:3d:aa:80 txqueuelen 1000 (Ethernet)
RX packets 4823 bytes 576628 (563.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3797 bytes 672394 (656.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens33:1:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.133.162 netmask 255.255.255.0 broadcast 192.168.133.255
ether 00:0c:29:3d:aa:80 txqueuelen 1000 (Ethernet)

ens37: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.125 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 fe80::4ff:774a:4d4c:50d3 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:3d:aa:8a txqueuelen 1000 (Ethernet)
RX packets 468507 bytes 343799561 (327.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 401829 bytes 258994097 (246.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ens37:1:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.59.33 netmask 255.255.0.0 broadcast 169.254.255.255
ether 00:0c:29:3d:aa:8a txqueuelen 1000 (Ethernet)

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 80599 bytes 46592307 (44.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 80599 bytes 46592307 (44.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:90:46:e7 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
  • 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.

explain :192.168.133.162 The vip Later as a test IP, Particular attention .

      
      
[[email protected]
~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.133.160 hisdb1
#Public IP (ens33)
192.168.133.160 hisdb1
192.168.133.161 hisdb2

#Private IP (ens37)
192.168.11.125 hisdb1-priv
192.168.11.126 hisdb2-priv

#Virtual IP
192.168.133.162 hisdb1-vip
192.168.133.163 hisdb2-vip

#Scan IP
192.168.133.164 hisdb-scan
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.

1.2、 Login authentication

      
      
[[email protected] ~]$ sqlplus sys/[email protected]:1521/pacs as sysdba
[[email protected] ~]$ sqlplus sys/[email protected]:1521/pacs as sysdba
  • 1.
  • 2.

explain : Two nodes use hisdb1-vip Can log into the database .

1.3、 State of the cluster

      
      
[[email protected]:/home/grid]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.LISTENER.lsnr
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.OCR.dg
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.asm
ONLINE ONLINE hisdb1 Started
ONLINE ONLINE hisdb2 Started
ora.gsd
OFFLINE OFFLINE hisdb1
OFFLINE OFFLINE hisdb2
ora.net1.network
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.ons
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE hisdb2
ora.cvu
1 ONLINE ONLINE hisdb1
ora.hisdb1.vip
1 ONLINE ONLINE hisdb1
ora.hisdb2.vip
1 ONLINE ONLINE hisdb2
ora.oc4j
1 ONLINE ONLINE hisdb1
ora.orcl.db
1 ONLINE ONLINE hisdb1 Open
2 ONLINE ONLINE hisdb2 Open
ora.pacs.db
1 ONLINE ONLINE hisdb1 Open
2 ONLINE ONLINE hisdb2 Open
ora.scan1.vip
1 ONLINE ONLINE hisdb2
  • 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.

explain : Note here scan ip stay hisdb2 On .

1.4、vip state

see vip 192.168.133.162 state

      
      
[[email protected] bin]# ./srvctl status vip -n hisdb1
VIP hisdb1-vip is enabled
VIP hisdb1-vip is running on node: hisdb1
[[email protected] bin]# pwd
/u01/app/11.2.0/grid/bin
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.

2、 Simulate anomalies

2.1、 close vip

Now shut down vip 192.168.133.162.

      
      
[[email protected] bin]# ./srvctl stop vip -n hisdb1 -f
[[email protected] bin]# ./srvctl status vip -n hisdb1
VIP hisdb1-vip is enabled
VIP hisdb1-vip is not running
  • 1.
  • 2.
  • 3.
  • 4.

explain : close hisdb1 Of vip after ,ifconfig Will not show ens33:1 Information .

2.2、 State of the cluster

close hisdb1-vip Then view the cluster status .

      
      
[[email protected]:/home/grid]$
crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.LISTENER.lsnr
OFFLINE OFFLINE hisdb1
ONLINE ONLINE hisdb2
ora.OCR.dg
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.asm
ONLINE ONLINE hisdb1 Started
ONLINE ONLINE hisdb2 Started
ora.gsd
OFFLINE OFFLINE hisdb1
OFFLINE OFFLINE hisdb2
ora.net1.network
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.ons
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE hisdb2
ora.cvu
1 ONLINE ONLINE hisdb1
ora.hisdb1.vip
1 OFFLINE OFFLINE

ora.hisdb2.vip
1 ONLINE ONLINE hisdb2
ora.oc4j
1 ONLINE ONLINE hisdb1
ora.orcl.db
1 ONLINE ONLINE hisdb1 Open
2 ONLINE ONLINE hisdb2 Open
ora.pacs.db
1 ONLINE ONLINE hisdb1 Open
2 ONLINE ONLINE hisdb2 Open
ora.scan1.vip
1 ONLINE ONLINE hisdb2
  • 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.

explain : Now the node 1 Monitoring status and vip Turn into OFFLINE. And through nodes 1 Of public ownership IP、VIP Cannot log into the database . Through node 2 Of public ownership ip、vip、scan ip The connection is normal .

      
      
[[email protected] ~]$ sqlplus sys/[email protected]:1521/pacs as sysdba
Report errors :
ORA-12543: TNS:destination host unreachable
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[[email protected] ~]$ sqlplus sys/[email protected]:1521/pacs as sysdba
Report errors :ORA-12541:TNS:no listener
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.

2.3、 Solution

2.3.1、 Trial and error scheme

It is found that the listening status is off,rac Environment with oracle The user starts listening . explain :scan ip At the node 2, The following will happen .

scan ip At the node 1 The author did not save the data after the test , But you can also test it yourself and leave a message in the comment area .

      
      
[[email protected] ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-JUL-2022 13:24:22

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 22-JUL-2022 13:24:05
Uptime 0 days 0 hr. 0 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener
Log File /u01/app/oracle/diag/tnslsnr/hisdb1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hisdb1)(PORT=1521)))
The listener supports no services
The command completed successfully
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.

A few minutes later, no service was found , Even if alter system register Re register to listen , Still no service .

grid The user views the monitoring situation as follows , Abnormal listening .

      
      
[[email protected] ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-JUL-2022 13:26:00

Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-12541:
TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.

Use at this time grid The user starts listening .

      
      
[[email protected] ~]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-JUL-2022 13:26:25

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

Starting /u01/app/11.2.0/grid/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/11.2.0/grid/network/admin/listener.ora
Log messages written to /u01/app/grid/diag/tnslsnr/hisdb1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

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 22-JUL-2022 13:26:25
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener
Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener
Log File /u01/app/grid/diag/tnslsnr/hisdb1/listener/alert/log.xml
Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
  • 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.

View the cluster status , Found Not All Endpoints Registered Report errors , As shown below , This error is successfully simulated .

This error report was also encountered by the author during a patrol inspection , Presumably, the customer used oracle The user found that the status was wrong after starting monitoring , And then use grid The user starts listening , Check the monitoring status as above and think it is normal , Here, the author reproduces the problem and tests the use node 1 Of public ownership IP and VIP You can still connect to the database , So this leads to customers thinking that database monitoring has returned to normal .

      
      
[[email protected] ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.LISTENER.lsnr
ONLINE INTERMEDIATE hisdb1 Not All Endpoints R
egistered
ONLINE ONLINE hisdb2
ora.OCR.dg
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.asm
ONLINE ONLINE hisdb1 Started
ONLINE ONLINE hisdb2 Started
ora.gsd
OFFLINE OFFLINE hisdb1
OFFLINE OFFLINE hisdb2
ora.net1.network
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
ora.ons
ONLINE ONLINE hisdb1
ONLINE ONLINE hisdb2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE hisdb2
ora.cvu
1 ONLINE ONLINE hisdb1
ora.hisdb1.vip
1 ONLINE ONLINE hisdb1
ora.hisdb2.vip
1 ONLINE ONLINE hisdb2
ora.oc4j
1 ONLINE ONLINE hisdb1
ora.orcl.db
1 ONLINE ONLINE hisdb1 Open
2 ONLINE ONLINE hisdb2 Open
ora.pacs.db
1 ONLINE ONLINE hisdb1 Open
2 ONLINE ONLINE hisdb2 Open
ora.scan1.vip
1 ONLINE ONLINE hisdb2
  • 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.

The solution of this trial and error solution :

      
      
[[email protected] ~]$ ps -ef|grep tns
root 32 2 0 10:28 ? 00:00:00 [netns]
oracle 10097 1 0 13:24 ? 00:00:00 /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit
grid 10230 1 0 13:26 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 10297 10169 0 13:27 pts/0 00:00:00 grep --color=auto tns
[oracle[email protected]:/home/oracle]$ ps -ef |grep tns
root 32 2 0 10:28 ? 00:00:00 [netns]
grid 3386 1 0 10:30 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 3432 1 0 10:30 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit
oracle 8445 5023 0 13:28 pts/0 00:00:00 grep --color=auto tns
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.

explain : Find out hisdb1 There are two listeners , Database ORACLE_HOME There is also a , Cause the port 1521 Occupy ,kill process 10097, After that, the monitoring returned to normal .

2.3.2、 Correct scheme

As you can see , The monitor didn't get up , It should be in hisdb1 use grid The user starts listening , The above exception will not appear , and vip Also open with monitoring .

      
      
[[email protected]:/home/grid]$ lsnrctl start
[[email protected] bin]# ./srvctl status vip -n hisdb1
VIP hisdb1-vip is enabled
VIP hisdb1-vip is running on node: hisdb1
  • 1.
  • 2.
  • 3.
  • 4.
原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207222132321447.html