Explanation of four IP addresses in oracle11gr2rac

Source: Internet
Author: User
Many of you are confused about the four IP addresses used to configure oracle11gr2rac. This article will describe them here. Open the etchosts file catetchosts # PublicIP192.168.1.138rac1. localdomainrac1194251.139rac2. localdomainrac2 # PrivateIP172.16.10.138rac1-pr of a RAC Node

Many of you are confused about the four IP addresses used to configure oracle 11gr2 rac. This article will describe them here. Open the/etc/hosts file of a RAC node cat/etc/hosts # Public IP 192.168.1.138rac1.localdomain rac1 192.168.1.139rac2.localdomain rac2 # Private IP 172.16.10.138rac1-pr

Many of you are confused about the four IP addresses used to configure oracle 11gr2 rac. This article will describe them here.

Open the/etc/hosts file of a RAC Node

Cat/etc/hosts

# Public IP

192.168.1.138rac1.localdomain rac1

192.168.1.139rac2.localdomain rac2

# Private IP

172.16.10.138rac1-priv. localdomain rac1-priv

172.16.10.139rac2-priv. localdomain rac2-priv

# Virtual IP

192.168.1.140 rac1-vip.localdomain rac1-vip

192.168.1.141 rac2-vip.localdomain rac2-vip

# SCAN IP

192.168.1.142 rac-scan.localdomain rac-scan


Four IP addresses are designed in this file, including Public IP, Private IP, Virtual IP, and scan ip.

Private ip: Internal IP address. Used for communication between nodes. The communication content includes network heartbeat and cache fusion.
Public ip: External IP address. It is used to provide external data services.
Virtual IP: Virtual IP address. It is used for failover.

Each node in Oracle RAC has a virtual IP address (VIP), which is in the same CIDR block as the public ip address. The vip is attached to the public network interface.
The major difference between Virtual IP and public ip is that VIP is floating while public ip is fixed. When all nodes are running normally, the VIP address of each node is allocated to the public NIC. In the ifconfig command in linux, there are two IP addresses on the public NIC. If one node is down, the VIP of this node will be transferred to the node that is still running. That is, there are three IP addresses on the public NIC of the surviving node.

If there is no vip, the process of the connection failure node will have a long tcp timeout wait to return an error. When the vip node becomes invalid, the vip will drift to other nodes, the process connecting to the vip can quickly return an error, so that you can try to connect to other active nodes faster and avoid the client repeatedly connecting to the node 1 instance. If transparent application failover options are configured for both applications and clients, you can re-connect to the remaining instances on the client.

Another reason for using Virtual ip is I think it is Server Load balancer. When the client configures tnsnames. ora, the vip is used in some cases, while the Public IP must be used in some cases. For example, when you locate a deadlock in a database, you can use a Public IP to connect to the machine you want to process. On the contrary, when using VIP, there will be uncertainty, because Server Load balancer is enabled by default, that is, if you want to connect to server A, the system will assign you A server B.


SCAN IP: In oracle 11gR2, the scan ip address appears as a new IP address. The scan ip address is a newly added connection layer between the oracle client and the database. When a client accesses the IP address, connect to the scan ip listener. When the scan ip listener receives the connection request, it forwards the client connection request to the vip listener on the corresponding instance according to the LBA algorithm, this completes the connection process between the client and the server. Simplified as follows:
Client-> scan listener-> local instance
You can also regard scan as a virtual host name, which corresponds to the entire RAC cluster. The client host can access any node of the Database Cluster by using the scan name. Of course, the accessed nodes are random. oracle strongly recommends configuring resolution SCAN in the round robin mode of the DNS Server to achieve Load Balancing (that is, rotating the IP address corresponding to the SCAN connection ). This is similar to the principle of implementing Load Balancing through the vip and listener loadbalance configurations.


Why does a SCAN ip address be added after a Virtual IP address is available?

Before oracle 11.2, vip is used when the client connects to the database. If your oracle cluster has four nodes, the client's tnsnames. in ora, there should be a connection string of four vip hosts. If a node is added to the cluster, You need to modify the tnsnames for each client connected to the database. ora.


After scan is introduced, it facilitates an interface for client connection. As the name suggests, single client access name and simple client connection name are unique names and are unique within the company's network, in addition, DNS can be resolved to three IP addresses. You only need to know this name when connecting the client and connect to it. Each scan vip corresponds to a scan listener, services in the cluster are registered on each scan listener. The scan listener accepts client requests and foward them to different Local listener. The listener of the local server provides services to the client.


Scan ip addresses are mainly used to simplify client connection. If your oracle cluster has 20 nodes and the client is connected, do you need to configure 20 VIPs? If scan is used, you only need a scan name. scan will help you with the rest.

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.