Oracle RAC Cluster SCAN description

Source: Internet
Author: User
Tags failover node server


1 SCAN Overview

Before a netizen in my blog message said my RAC build did not write scan configuration, this should have been written before, but just searched a bit, did not find, just re-clean up, and do the experiment, the experiment with Oracle 12c test.

Before Oracle 11g, we went to connect to a RAC cluster, all configured as follows:

Dave_rac=

(DESCRIPTION =

(Address_list =

(load_balance = yes)

(Failover=on)

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.68) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.69) (PORT = 1521))

)

(Connect_data =

(service_name = Dave)

(Failover_mode= (Type=select) (Method=basic))

)

)

The 68 and 69 here are the VIP addresses, which are virtual IPs on the public network card. Then we only have 2 nodes here, if we increase the number of RAC cluster, then we need to modify all the client configuration, this is very troublesome.

So in Oracle 11gR2, the features of the scan (single clientaccess Name) are introduced. Scan is a domain name, can resolve at least 1 IP, up to 3 scan IP, the client can access the database through this scan name, in addition the scan IP must be with the public IP and VIP in a subnet.

After the scan is enabled, a layer of virtual service layer is added between the database and the client, that is, scan IP and scan IP Listener, the client only needs to configure the TNS information of scan IP, through Scanip Listener, connect the background cluster database. This way, regardless of whether the cluster database has an operation to add or remove nodes, there is no effect on the client, and there is no need to modify the configuration.

There are 3 ways to configure scan:


1. Using the/etc/hosts file

This is the most common way we use, but the disadvantage can only correspond to a scan IP, the method Oracle is not recommended, but simple, do not need a separate DNS server, using this method, the client still need VIP to link. Oracle recommends the use of 2 other methods to implement the scan feature.

2. Define the domain name in DNS and only configure it in DNS to implement the scan function.

3. With grid naming Server (GNS), you need to configure DNS and DHCP to implement the scan feature.

Once configured, write scan name directly in the client's TNSNames, as follows:

Racscan =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = rac-scan.gns.cndba.com) (PORT = 1521))

(Connect_data =

(SERVER = dedicated)

(service_name = Dave)

)

)

After the RAC increases the deletion node, the client does not need to be modified.

2 SCAN Workflow

After enabling the scan feature, in addition to a few more scan IP, there will be more than a few scan IP Listener, each scan IP corresponding to a scan IP Listener, for performance reasons, each scan IP and its corresponding scan IP Listener will be Independently assigned to each node.

If an exception occurs in one of the nodes in the cluster that is running the scan IP, the remaining normal scan IP nodes are automatically taken over.

If the client is a version of 11g R2, the client simply configures the domain name resolution in TNS to implement failover, and if the client version is less than 11g R2, multiple scan IP addresses cannot be resolved through the domain name, so if you want to implement failover, The address of the 3 scan IP must be configured in TNS in the client, which is why Oracle strongly recommends that the client use 11g R2 when using a 11g R2 database.

is the workflow flowchart for scan, the right side of the graph is a 4-node RAC cluster, so there are 4 local Listener. 3 Scan IP and 3 scan Listeners are configured. These 3 scan IPs are randomly dropped on the RAC node.

Client link, will be randomly connected to a certain scan IP and the corresponding scan IP listner, scan IP listener received the connection request, according to the LBA algorithm (least loaded instance), The connection request of the client is forwarded to the VIP Listener on the corresponding instance, which completes the connection process between the client and the server.

The simple point is:

Client, Scan Listener, Locallistener, local instance

3 SCAN for several noun descriptions

3.1 SCAN VIP

Scan VIP, or scan IP, is an IP address resolved by DNS or GNS, hosts. Currently, the SCANVIP can have up to three, and they are cycled to the client's request.

Scan VIP number and number of nodes does not matter, as shown, 4 nodes, 3 SCAN vip,scan VIP is randomly on which node, the process is also dynamic change.

3.2 GNS VIP

GNS VIP with Scan VIP, GNS VIP is to provide GNS service IP address, it is bound to a node's public IP on the network card, when the node fails, GNS resources will automatically switch to other normal nodes continue to provide GNS resolution service. If we do not use the GNS parsing method, then there will be no gns VIP.

3.3 SCAN LISTENER

Scan Listener to implement the load balancing function of scan. If there are three scan VIPs on the RAC, then there are three scan listeners, each of which listens to the scan VIP connection request.

The registration of the scan listener is controlled by the Remote_listener parameter, and any instance is registered with all scan listeners, so scan LISTENER contains the names of all instances.

This allows the scan listener to understand the operation of all instances in real time, so it can accurately redirect the connection to the local listener on the idle server.

Scan listener is randomly assigned to the node server with scan VIP, if a node fails, the SCANVIP running on this node will drift, then the scan listener also drift to the normal node, continue to scan VIP listening connection request, When the Pmon process dynamically updates the instance information to the scan listener the next time, it re-accepts the client connection.

3.4 Remote_listener

Oracle parameter, after the parameter is set, any instance is registered with the scan listener, so the scan listener can distribute the connection request to the node local listener load-balanced.

Because the scan IP has multiple, they correspond to the same domain name, so in the database, need to use Easyconnect naming method, need to modify Sqlnet.ora configuration file to add Ezconnect, such as:

NAMES. Directory_path= (Tnsnames,ezconnect).

Formatting: Remote_listener=scan:port, such as remote_listener=rac-scan.cndba.cn:1521.

Once configured, the Pmon process for each node of the RAC database is registered with each scan Listener in a broadcast manner, while the CRS background process, ONS, collects the load status of each node and notifies scan Listener for scan Listener the new connection is assigned to the node with the lowest current load, depending on the load situation.

Management theory part, so much, next, will organize 2 Oracle 12c environment using DNS and GNS implementation of scan blog, specific understanding of how to achieve this function.

Reference:

Grid Infrastructure single clientaccess Name (SCAN) explained (document ID 887522.1)

--------------------------------------------------------------------------------------------

All rights reserved, the article prohibits reprint, otherwise investigates the legal liability!

Aboutdave:

--------------------------------------------------------------------------------------------

qq:251097186

Email: [email protected]

Blog:http://blog.csdn.net/tianlesoftware

Weibo:http://weibo.com/tianlesoftware

Twitter:http://twitter.com/tianlesoftware

Facebook:http://www.facebook.com/tianlesoftware

Linkedin:http://cn.linkedin.com/in/tianlesoftware

Dave's QQ Group:

--------------------------------------------------------------------------------------------

Note: Add group must indicate tablespace and data file relationship | Do not repeat the addition group

cndba_1:62697850 (empty) cndba_2:62697716 (full) cndba_3:283816689

cndba_4:391125754 cndba_5:104207940 cndba_6:62697977 cndba_7:142216823 (full)

Oracle RAC Cluster SCAN description

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.