A high availability virtual IP (HAVIP) is a private IP address assigned by VPC CIDR blocks. It is usually used together with high-availability softwares, such as Keepalived and Windows Server Failover Cluster, to build a highly available primary/secondary cluster.
Note:
- HAVIP is currently in beta. If you are a new user outside Shanghai and Guangzhou regions and want to try it out, please submit an application to be added to the beta list.
- Switching between primary/secondary servers in Shanghai and Guangzhou regions may take up to 1-2 minutes. Therefore, HAVIP is currently unavailable to new users in these two regions. We recommend using Tencent Cloud CLB and other services to meet your requirements.
- To guarantee the CVM high availability in a primary/secondary cluster, we recommend assigning CVMs to different hosts using placement group. For more information about the placement group, see Placement Group.
Typically, a high availability primary/secondary cluster consists of two servers: an active primary server and a standby secondary server. The two servers share the same VIP (virtual IP) which is only valid for the primary server. When the primary server fails, the secondary server will take over the VIP to continue providing services.
Note:
Keepalived is a VRRP-based high availability software. To use Keepalived, first complete its configuration in the
Keepalived.conf
file.
The following figure shows the HAVIP architecture.
According to the example figure, CVM1 and CVM2 can be built into a high availability primary/secondary cluster with the following steps:
Some public cloud vendors do not support binding a private IP to CVM through ARP announcement due to security reasons such as ARP spoofing. If you directly use a private IP as virtual IP in the “Keepalived.conf” file, Keepalived will not be able to update the IP to MAC mapping during the primary/secondary server virtual IP switch. In this case, you have to call an API to switch the IP.
Using Keepalived configuration as an example, the IP configurations are as follows:
vrrp_instance VI_1 {
state BACKUP #Secondary device
interface eth0 #ENI name
virtual_router_id 51
nopreempt #Non-preempt mode
#preempt_delay 10
priority 80
advert_int 1
authentication {
auth_type PASS
auth_pass 1111
}
unicast_src_ip 172.17.16.7 #Private IP of the local device
unicast_peer {
172.17.16.13 #IP address of the peer device, for example: 10.0.0.1
}
virtual_ipaddress {
172.17.16.3 #Enter the HAVIP address you have applied for in the console.
}
garp_master_delay 1
garp_master_refresh 5
track_interface {
eth0
}
track_script {
checkhaproxy
}
}
If there is no HAVIP, the following section of the configuration file will be invalid.
virtual_ipaddress {
172.17.16.3 #Enter the HAVIP address you have applied for in the console.
}
Was this page helpful?