In the OracleRAC environment, each node has multiple IP addresses, namely PublicPrivateVip. What is the difference between the three IP addresses? Which occasions are used separately? Let's take a look at the answers from foreigners. 1. privateIPaddressisusedonlyforinternalclusteringprocessing (CacheFusion) private IP for heartbeat Synchronization
In the Oracle RAC environment, each node has multiple IP addresses: Public, Private, and Vip. What is the difference between these three IP addresses? Which occasions are used separately? Let's take a look at the answers from foreigners. 1. private IP address is used only for internal clustering processing (Cache Fusion) private IP for heartbeat Synchronization
In the Oracle RAC environment, each node has multiple IP addresses: Public, Private, and Vip. What is the difference between these three IP addresses? Which occasions are used separately? Let's take a look at the answers from foreigners.
1. private IP address is used only for internal clustering processing (Cache Fusion)
Private IP addresses are used for heartbeat synchronization, which can be ignored directly at the user level. This Ip address is used to ensure the private IP addresses used for data synchronization between the two servers.
2. virtual IP is used by database applications to enable fail over when one cluster node fails
The virtual IP address is used for client applications to support failover. In other words, one instance is suspended and the other instance is automatically taken over. The client does not feel any way.
This is one of the reasons for using RAC, and I think it is Server Load balancer.
3. public IP adress is the normal IP address typically used by DBA and SA to manage storage, system and database.
Public IP addresses are generally used by administrators to ensure that they can operate on the right machine. I prefer to call them real IP addresses.
Through the above explanation, it is hard to understand that, as a DBA, When configuring tnsnames. ora, vip is used in some cases, while public IP must be used in some cases. For example, when you locate a database deadlock and use a public ip address, you can ensure that you are connected to the machine you want to handle. On the contrary, when using a virtual ip address, there will be uncertainty, because Server Load balancer is enabled by default, that is, if you want to connect to server A, the system allocates server B to you.
For example:
The following example shows how to use the VIP
- Infodb8 =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = 138. *. 1.81) (PORT = 1521 ))
- (ADDRESS = (PROTOCOL = TCP) (HOST = 138. *. 1.82) (PORT = 1521 ))
- (LOAD_BALANCE = yes)
- (FAILOVER = ON)
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = infodb)
- (FAILOVER_MODE =
- (TYPE = SELECT)
- (METHOD = BASIC)
- (RETRIES = 30)
- (DELAY = 5)
- )
- ))
- In the following example, the Public IP address is used to specify the connection HOST 1. Note that the red font infodb1 further limits the connection instance.
- INFODB83 =
- (DESCRIPTION =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP) (HOST = 138. *. 1.83) (PORT = 1521 ))
- )
- (CONNECT_DATA =
- (SERVICE_NAME = infodb)
- (INSTANCE_NAME = infodb1)
- )
- (HS = OK)
- )
Each node in Oracle RAC has a virtual IP address (VIP), which is in the same CIDR block as the public IP address.
When no VIP is available, the Oracle client determines the server fault by "TCP/IP protocol stack timeout. The TCP/IP protocol stack is implemented as part of the OS Kernel. different operating systems have different thresholds. The time that the database exception occurs depends on the implementation of the OS Kernel, although some operating systems allow this threshold value to be modified, it will have an unknown impact on other programs. Therefore, oracle RAC introduces VIP to avoid dependency on TCP protocol stack timeout.
The main difference between VIP and IP is that VIP is floating while 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.
When a node goes down, the real IP address of the node cannot be connected, but the virtual IP address of the node can be connected. It automatically transfers the client connection request to the active node.
In the tnsname. ora file, specify the Address list, and the client randomly selects a node to connect to the database, rather than the sequential selection.
VIP features:
1. the VIP is created by the vipterware script in the final phase of installation;
2. As a Nodeapps CRS Resource, VIP is registered to OCR and maintained by CRS;
3. the VIP address is bound to the public Nic of the node. The public Nic has two addresses;
4. When a node fails, CRS transfers the VIP address of the faulty node to another node;
5. The Listener of each node listens to the public IP address and VIP address of the public nic at the same time;
6. Generally, tnsname. ora of the client is configured to point to the VIP address of the node;
From the above 6th, we can ask a question. If a node is added, the client's tnsname. ora needs to be added to the VIP of the new node. Imagine that it is especially difficult to maintain multiple clients and add multiple nodes. Therefore, Oracle11gR2 introduces the concept of scan.
Scan, single client access name. Simple client connection name, which is a unique name that is unique within the company's network and can be resolved to three IP addresses in DNS. You only need to know this name when connecting the client, and connect. Each scan vip corresponds to a scan listener. Services in the cluster are registered on each scan listener. scan listener accepts client requests, and foward to different Local listener, or by the local listener to provide services to the client.
Note: scan does not have to resolve to three ip addresses, either of which is enough. We recommend three to prevent single point of failure (spof.
Principles and features of VIP
Oracle's TAF is built on the VIP technology. What is the difference between an IP address and a VIP address is that the IP address uses the TCP layer timeout and the VIP uses the application layer instant response. VIP is a floating IP address. When a node fails, it is automatically transferred to another node.
Suppose there is a RAC with two nodes, and each node has a VIP during normal operation. VIP1 and VIP2. when Node 2 fails, such as an abnormal relationship. RAC performs the following operations:
1). After detecting an exception on the rac2 node, CRS will trigger Clusterware reconstruction, and finally remove the rac2 node from the cluster. Node 1 will form a new cluster.
2). The RAC Failover Mechanism transfers the VIP address of Node 2 to node 1. At this time, the PUBLIC Nic of Node 1 has three IP addresses: VIP1, VIP2, and PUBLIC IP1.
3) Your connection request to VIP2 will be forwarded to node 1 by the IP layer route
4). Because VIP2 is available on node 1, all data packets pass through the routing layer, network layer, and transmission layer smoothly.
5). However, only VIP1 and public IP1 IP addresses are monitored on node 1. VIP2 is not monitored, so no program at the application layer receives this packet, and this error is immediately captured.
6) The customer segment can receive this error immediately, and then the customer segment will re-initiate a connection request to vip1.
VIP features:
1). VIP is created through VIPCA script
2). VIP is registered to OCR as the CRS Resource of Nodeapps type and maintained by CRS.
3). The VIP address is bound to the public Nic of the node. Therefore, the public Nic has two addresses.
4) When a node fails, CRS transfers the VIP address of the faulty node to another node.
5). the Listener of each node listens to the public ip address and VIP address on the public nic at the same time.
6). The client tnsnames. Ora usually configures the VIP to point to the node.