watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=

The subject part

stay Oracle in ,RAC Medium Public IP、Private IP、Virtual IP、SCAN IP、GNS VIP And HAIP What are the functions of ?

     

Answer section

from Oracle 11g Start , install RAC Need at least 7 individual IP Address , Two network cards ( A public network card , A private network card ), among public、vip and scan All in the same segment , It’s a public network card ,private In another network segment , It’s a private network card . The host name cannot contain a down line , Such as :RAC_01 It’s not allowed . Through execution ifconfig -a Check whether the network device names of the two nodes are consistent . in addition , In configuration /etc/hosts After the document , In the installation RAC Before , Public network 、 Private Internet 4 individual IP Sure ping through , Other 3 individual IP You can’t ping Generalists are normal . In the installation RAC when , Its IP The layout of the address is similar to the following table :

node / Host name

The interface name

Address type

IP Address

Registered location

raclhr-12cR1-N1

raclhr-12cR1-N1

Public

192.168.59.160

/etc/hosts

raclhr-12cR1-N1-vip

Virtual

192.168.59.162

/etc/hosts

raclhr-12cR1-N1-priv

Private

192.168.2.100

/etc/hosts

raclhr-12cR1-N2

raclhr-12cR1-N2

Public

192.168.59.161

/etc/hosts

raclhr-12cR1-N2-vip

Virtual

192.168.59.163

/etc/hosts

raclhr-12cR1-N2-priv

Private

192.168.2.101

/etc/hosts

raclhr-12cR1-scan

SCAN

192.168.59.164

/etc/hosts

Its presence /etc/hosts The configuration in the file is as follows :

 1[root@raclhr-12cR1-N2 ~]# more /etc/hosts
 2127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
 3::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
 4#Public IP
 5192.168.59.160            raclhr-12cR1-N1
 6192.168.59.161            raclhr-12cR1-N2
 7#Private IP
 8192.168.2.100             raclhr-12cR1-N1-priv
 9192.168.2.101             raclhr-12cR1-N2-priv
10#Virtual IP
11192.168.59.162            raclhr-12cR1-N1-vip
12192.168.59.163            raclhr-12cR1-N2-vip
13#Scan IP
14192.168.59.164            raclhr-12cR1-scan

Let’s talk about RAC Some problems in environment IP And its role .

( One )Public IP

Public IP It’s called the public network IP, It’s real on the NIC IP. Each node is installing Oracle Software needs to be configured in advance Public IP.Oracle adopt Public IP Providing network services to the outside world . If RAC in Public IP The network card is faulty , Then the node will not be able to continue to provide external services , therefore , It is suggested that the multi network card binding technology at the operating system level should be enabled IP Failover. If it’s a double node RAC Environmental Science , So you need to tnsnames.ora Write the… Corresponding to the two nodes in the file Public IP、 Port number and communication protocol . If the load balancing function is not turned on ( soft / Hardware ), So when tnsnames.ora First in file ADDRESS Corresponding host failure or shutdown , So when the client connects ,Oracle Will wait for a network timeout , Then continue to connect the second ADDRSS Corresponding database instance . Even if RAC A node can still provide external services , Users need to wait a few seconds for each connection . Network timeout can make the user experience quite bad . therefore , stay Oracle 10g RAC in VIP(Virtual IP) It’s a perfect solution to this problem .

( Two )Private IP

about Oracle colony , Private network communication is very important , Because most of the communication between nodes is realized through private network . There are basically two types of private network communication : The first is the communication between cluster layers ; The second is the communication between database instances . The first kind of communication ( for example : Network heartbeat between nodes ) The main feature of this is its persistence 、 High real-time requirement , But the amount of data is small , So pass TCP/IP Protocol delivery is OK . The second type of communication is cache fusion (Cache Fusion) Data transfer between instances caused by , It is characterized by a large amount of data , And the speed requirements are very high ,TCP/IP The agreement can’t meet the requirement at this time , So we need to use UDP perhaps RDS, meanwhile Oracle It is also recommended that users configure the private network of the cluster for high availability and load balancing .

And Public IP equally ,Private IP It’s called private network IP Or heartbeat IP, It’s also real on the NIC IP, Each node is installing Oracle Cluster software needs to be configured in advance Private IP.Private IP It is used for multi node heartbeat synchronization and Cache Fusion Etc , stay Oracle 12c We still need to serve as Flex ASM The task of . Of course , If not set Private IP But by the Public IP You can also accomplish these tasks . however , Doing so will only make Public IP The network card is overloaded , Once the network card device fails , The cluster will split and kick out some nodes to ensure consistency , send RAC Unstable performance . about Oracle 10g and 11gR1 Version of cluster ,Oracle It does not provide the high availability and load balancing features of private networks , Instead, users are advised to configure at the operating system level ( for example Linux bonding、AIX etherchannel etc. ), So as to open the implementation of multi network card binding technology at the operating system level IP Failover. from Oracle 11.2.0.2 The release of the HAIP Technology provides the high availability and load balancing features of private networks , So as to replace the operating system level network card binding technology , More powerful and compatible .

( 3、 … and )Virtual IP(VIP)

VIP yes Oracle 10g RAC New features , It’s called virtual IP.VIP Is in Public IP On the network card where it is located by Oracle Cluster software virtual out of a IP, Need and Public IP Set in the same subnet segment .Oracle Before installing the cluster software, just define (/etc/hosts file ) that will do , Without prior configuration . Under normal circumstances ,VIP and Public IP The function is as like as two peas . Background processes PMON For each node VIP Registered instance information of the listener , You’ll see two addresses in the local listener host, One is Public IP, One is VIP. When a node fails ,Oracle Cluster software will bring VIP Automatically float to other nodes , But the local listener doesn’t drift to other nodes . client tnsnames.ora In file host Options no longer need to be configured Public IP And choose configuration VIP, The advantage of this is that at the double node RAC In architecture, when the first node fails , The second node will have two VIP, The client connects to the first VIP The second one will be connected immediately after the failure VIP The corresponding example , The whole switching process is very short , Users can’t feel it at all RAC There is a node failure in the architecture . The whole connection process can be said to be transparent to users . But it’s not really transparent , Users can still know the whole RAC How many nodes does the architecture consist of , therefore ,Oracle 11g RAC Introduced in the SCAN IP New concept of , It can realize the transparency of user connection , Users no longer need to know the whole RAC How many nodes are there in the architecture .

VIP Characteristics :

(1)VIP It’s through VIPCA Script created .

(2)VIP As Nodeapps Type of CRS Resource Sign up to OCR in , And by the CRS Maintenance state .

(3)VIP Will be bound to the node Public NIC , so Public The network card has two addresses .

(4) When a node fails ,CRS The fault node will be VIP Transfer to other nodes .

(5) For each node LISTENER They’ll listen at the same time Public Network card Public IP and VIP.

(6) Client’s tnsnames.ora In general, you will configure VIP.

You can use the following command to make the node 1 Of VIP Force drift to node 2 Up :

1crsctl relocate resource ora.raclhr-11gr2-n1.vip -n raclhr-11gR2-N2 -f

The following command is for Oracle 11g Before the release :

1crs_relocate ora.lhr-11gr2-rac1.vip -c lhr-11gR2-rac2 -f

( Four )SCAN IP

from Oracle 11gR2 RAC Start introducing SCAN(Single Client Access Name, The single client access name of the cluster )IP The concept of , It is equivalent to adding a virtual network service layer between the client and the database , That is SCAN IP and SCAP IP LISTENER. On the client side tnsnames.ora In profile , Just configure SCAN IP, Then the user can access the database . Client pass SCAN IP、SCAN IP LISTENER To load balance connections to RAC database . Same as previous versions of RAC comparison , Use SCAN IP Is that , Backstage RAC Database add 、 When deleting a node , There is no need to modify the client configuration information .SCAN Provide a domain name to access RAC, The domain name can be resolved 1 A to 3 individual ( Be careful , most 3 individual )SCAN IP, Can pass DNS、GNS or /etc/hosts File to parse the implementation . It should be noted that ,SCAN IP、VIP and Public IP Must belong to the same subnet .

( 5、 … and )GNS VIP

GNS VIP yes Oracle 11g RAC New characteristics . In tradition RAC Architecture ,Public IP、Private IP、Virtual IP、SCAN IP It’s all made in advance . If it’s on GNS Services just need to be pre configured Public IP、Private IP that will do ,Virtual IP、SCAN IP It’s all by GNS Service from DHCP The server dynamically gets . To configure GNS Services need to be pre configured DNS and DHCP service ,GNS VIP It can be bound to any node Public Network card GNS service , If not configured GNS Services do not need to be configured GNS VIP. Configuration is more complex than traditional architecture , therefore , stay Oracle 11g RAC Rarely seen in Architecture GNS VIP.12c Flex Cluster The architecture must be configured GNS VIP.

( 6、 … and )HAIP(Highly Available IP)

stay Oracle 11.2.0.2 Before , The redundancies of private networks are usually achieved through OS Do network card binding on ( Such as Bond etc. ) To achieve , from Oracle 11.2.0.2 The version is coming out HAIP(Highly Available IP) Technology replaces the network card binding technology at the operating system level , More powerful 、 More compatible .HAIP Through the unique 169.254.* The network segment IP Address realizes high availability and load balancing of internal links in cluster . therefore , stay 11.2.0.2 Or later RAC Need to pay attention to 169.254.* Of IP The address cannot be occupied . With HAIP Technology can no longer rely on any third-party redundancy technology to achieve private network card redundancy .

resources ora.cluster_interconnect.haip Will start one to four local HAIP The address is attached to Private On the network adapter ( Private network card ). adopt HAIP complete Oracle RAC and ASM And other internal communications . If a private network card is physically damaged , Then the network card on the HAIP The address will drift to other available private networks . Multiple private network cards can be defined in the installation phase , It can also be in GRID Once the configuration is complete , By calling $GRID_HOME/bin/oifcfg setif Tools ( The order is :oifcfg setif -global eth2/192.168.1.0:cluster_interconnect) To configure the HAIP.

HAIP The number of depends on GRID The number of private network cards activated . If only 1 A private network card , that GRID Will be created 1 individual HAIP. If there are two private network cards , that GRID Two… Will be created HAIP. If there are more than two private network cards GRID establish 4 individual HAIP.GRID Most support 4 A private network card , And clusters actually use HAIP The number of addresses depends on the number of private network cards activated in the first node in the cluster . If you select more private network cards as Oracle Our private network , So superfluous 4 One of them can’t be activated .

management ora.cluster_interconnect.haip The purpose of this resource is ohasd.bin process . Their corresponding log be located $GRID_HOME/log/<nodename>/ohasd/ohasd.log as well as $GRID_HOME/log/<nodename>/agent/ohasd/orarootagent_root/orarootagent_root.log These two positions . stay HAIP resources online in the future , By operating system commands ifconfig -a You can see more, like eth1:1 Virtual network card ,HAIP The address is 169.254.X.X. Of course, you can also use GV$CLUSTER_INTERCONNECTS To view HAIP The address of .HAIP The corresponding address is automatically assigned by the system , Cannot be specified manually by user .

Oracle Database and ASM Examples can be found in HAIP To achieve high availability and load balancing of private network communication . The traffic of private network will realize load balancing on these private network cards , If a network card fails , It has HAIP It will automatically switch to other available private network cards , So as not to affect the communication of private network .Windows The platform currently does not support HAIP technology .

In some customer environments , Private Internet is through VLAN It’s drawn out , And out of network management requirements ,VLAN Of IP The address must be bound to the network card , The private network IP It must also be fixed IP Address ( Although press Oracle RAC Installation requirements of , The private network should be an independent and isolated network ), At this time HAIP Will not be able to allocate , That leads to dependence on it ASM Resource failed to start .HAIP There is a lot of Bug, If you meet with , Then you can put HAIP The function is disabled . If the user uses an operating system level binding or does not use a private network binding , Well, it can be done by RDBMS and ASM In the parameter file CLUSTER_INTECONNECTS Specifying a private address will HAIP Cover ( If there are multiple private Internet addresses , Please use colon to separate ). Although I say HAIP It still exists , however ASM Instance and RDBMS Instance will not be used later HAIP.