Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[Oracle Database] Oracle RAC (IX): SCAN

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The role of SCAN is to simplify the configuration of the client to connect to the database. The SCAN name of the node will remain the same regardless of whether the cluster is added or deleted, and the client does not need to make any changes. SCAN is a name that is resolved to up to 3 IP addresses (SCAN VIP) through DNS

SCAN VIP is used to receive client connections. SCAN VIP must be in the same subnet as the public network resources of the cluster. Each SCAN VIP will have a corresponding SCAN LISTENER, and SCAN LISTENER will only listen to the corresponding SCAN VIP, and they must run on the same node. SCAN VIP will be evenly distributed among the nodes of the cluster. For example, a cluster with 8 nodes will select 3 of them to run SCAN VIP. When there is a problem with the node running SCAN VIP, SCAN VIP will drift to other normal nodes. For a two-node cluster, if 3 SCAN VIP is configured, there must be two SCAN VIP in one node and one SCAN VIP in the other node.

SCAN VIP and SCAN LISTENER exist in the form of cluster resources, which are uniformly managed by the agent process of the cluster. SCAN VIP depends on the public network resources of the cluster, while SCAN LISTENER depends on the corresponding SCAN VIP resources. When the local node has problems, the SCAN VIP drifts to other nodes, the corresponding SCAN LISTENER also needs to drift with the SCAN VIP.

Connect to the database through SCAN

Phase 1: the PMON process of each node registers the services provided by the local instance with the listeners of the local node and each SCAN listener by accessing the database information. Local_listener specifies the location of local listeners that PMON needs to register, while remote_listener specifies the location of SCAN listeners that need to be registered. After that, both local node listeners and SCAN listeners are ready to receive client connections.

Phase 2: the client initiates a connection to the SCAN listener through the alias in tnsnames.ora. Because the SCAN listener is distributed in different nodes of the cluster, which node to connect to depends on which node DNS resolves the SCAN name to the SCAN VIP of which node (DNS returns the IP address corresponding to SCAN by polling).

After receiving the request sent by the client, the stage 3:SCAN listener forwards the client connection to the local listener of the node with the lowest load according to the responsibility of each node, and then the local listener of the corresponding node completes the connection with the client.

Server-side load balancing

The PMON process of the database instance registers the service information and workload information of the local instance with SCAN LISTENER. The workload information of each service at each node exists at the SCAN LISTENER level. SCAN LISTENER has been able to complete the server-side load balancing and send the received connection directly to the local listener of the node with the lowest load.

Phase 1: the client connects to a SCAN listener by specifying the tnsnames.ora alias of the SCAN.

The stage 2:SCAN listener analyzes the latest workload information of each node that applies for service, selects the node with the lowest load, and distributes the client connection to the listener of the corresponding node.

Phase 3: after the local node listener receives the connection, it checks whether there is a corresponding service registration and notifies the client to reconnect to the local node listener.

Stage 4: after receiving the information sent by the listener of the corresponding node of the server, the client reconnects to the new location.

Stage 5: after receiving the connection information, the local node listener completes the connection to the database.

Query the configuration of SCAN [root@wallet01 ~] # su-grid [grid@wallet01 ~] $srvctl config scanSCAN name: wallet.gscaifu.com, Network: 1/192.168.40.0/255.255.255.0/eth0SCAN VIP name: scan1, IP: / wallet.gscaifu.com/192.168.40.103SCAN VIP name: scan2, IP: / wallet.gscaifu.com/192.168.40.101SCAN VIP name: scan3 IP: / wallet.gscaifu.com/192.168.40.102 query SCAN status [grid@wallet01 ~] $srvctl status scanSCAN VIP scan1 is enabledSCAN VIP scan1 is running on node wallet01SCAN VIP scan2 is enabledSCAN VIP scan2 is running on node wallet03SCAN VIP scan3 is enabledSCAN VIP scan3 is running on node wallet02 query SCAN LISTENER configuration [grid@wallet01 ~] $srvctl config scan_listenerSCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521 query SCAN LISTENER status [grid@wallet01 ~] $srvctl status scan_listenerSCAN Listener LISTENER_SCAN1 is enabledSCAN listener LISTENER_SCAN1 is running on node wallet01SCAN Listener LISTENER_SCAN2 is enabledSCAN listener LISTENER_SCAN2 is running on node wallet03SCAN Listener LISTENER_SCAN3 is enabledSCAN listener LISTENER_SCAN3 is running on node wallet02 query local LISTENER status [grid@wallet01 ~] $lsnrctl status LISTENERLSNRCTL for Linux: Version 11.2.0.4.0-Production on 07-MAY-2019 15:36:20Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=LISTENER)) STATUS of the LISTENER----Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.4.0-ProductionStart Date 07-MAY-2019 13:20:31Uptime 0 days 2 hr. 15 min. 48 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File / u01/app/11.2.0.4/grid/network/admin/listener.oraListener Log File / u01/app/grid/diag/tnslsnr/wallet01/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=LISTENER) (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.40.34) (PORT=1521) (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.40.134) (PORT=1521) Services Summary...Service "+ ASM" has 1 instance (s). Instance "+ ASM1", status READY, has 1 handler (s) for this service...Service "gspublic" has 1 instance (s). Instance "wallet1", status READY, has 1 handler (s) for this service...Service "wallet" has 1 instance (s). Instance "wallet1", status READY, has 1 handler (s) for this service...Service "walletXDB" has 1 instance (s). Instance "wallet1", status READY, has 1 handler (s) for this service...The command completed successfully queries the status of LISTENER_SCAN1 [grid@wallet01] $lsnrctl status LISTENER_SCAN1LSNRCTL for Linux: Version 11.2.0.4.0-Production on 07-MAY-2019 15:36:57Copyright (c) 1991, 2013, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=LISTENER_SCAN1)) STATUS of the LISTENER----Alias LISTENER_SCAN1Version TNSLSNR for Linux: Version 11.2.0.4.0-ProductionStart Date 07-MAY-2019 13:20:31Uptime 0 days 2 hr. 16 min. 26 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File / u01/app/11.2.0.4/grid/network/admin/listener.oraListener Log File / u01/app/11.2.0.4/grid/log/diag/tnslsnr/wallet01/listener_scan1/alert/log.xmlListening Endpoints Summary... (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=LISTENER_SCAN1) (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=192.168.40.103) (PORT=1521)) Services Summary...Service "SYS$SYS.SCHEDULER$_EVENT_QUEUE.WALLET" has 1 instance (s) Instance "wallet2", status READY, has 1 handler (s) for this service...Service "gspublic" has 1 instance (s). Instance "wallet1", status READY, has 1 handler (s) for this service...Service "wallet" has 3 instance (s). Instance "wallet1", status READY, has 1 handler (s) for this service... Instance "wallet2", status READY, has 1 handler (s) for this service... Instance "wallet3", status READY, has 1 handler (s) for this service...Service "walletXDB" has 3 instance (s). Instance "wallet1", status READY, has 1 handler (s) for this service... Instance "wallet2", status READY, has 1 handler (s) for this service... Instance "wallet3", status READY, has 1 handler (s) for this service...The command completed successfully

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

  • Reverse Engineering practice of generating MyBatis in IDEA

    1. Build MyBatis Generator plug-in environment a. Add plug-ins dependent on pom.xml

    © 2024 shulou.com SLNews company. All rights reserved.

    12
    Report