Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
Two-machine hot standby is to use two servers to perform the same service together, in the process of real-time mutual backup, when a server failure, another can immediately detect the failure and take over the day server services, so that without human intervention in the case of automatic assurance system can continue to provide services. There are two common scenarios: using common storage devices, using different storage devices (which need to be synchronized through software), keeping the primary server active at the same time, the backup server in a listening state, and the backup server activating the backup server through heartbeat diagnostics when the primary server fails to start. Ensure the service is in normal use. This is mainly used to provide Web services to the server, in order to prevent server downtime caused by service interruption. The linux+heartbeat scheme is adopted. Here's how to write my implementation process:
Primary server:
System: CentOS
Host Name: Sev1.example.com #和从服务器名称不能相同
ip:10.0.0.211
Heartbeat Address: 100.0.0.211 #提供给心跳服务使用的, used to prosecute server running status
Backup server:
System: CentOS
Host Name: Sev2.example.com #和主服务器名称不能相同
ip:10.0.0.212
Heartbeat Address: 100.0.0.212 #提供给心跳服务使用的, used to prosecute server running status
Note: Each server needs two network card; Heartbeat address is the heartbeat service used to check the running state of the server, the heartbeat address to write, as long as the specification on the line, gateway, subnet mask do not write, the communication between the two network cards with only IP is enough, and other IP will not conflict.
After the server is configured, you need to set the following files:
Hosts
/etc/resolv.conf
/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0 # Main Network card
/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ETH1 # Heartbeat Detection network card
Sev1 the same configuration as the hosts content under the Sev2 host:
1 # does not remove the following line, or various programs 2 # that require receptacle functionality would fail. 3 127.0.0.1 localhost.localdomain localhost 4 5 10.0.0.211 sev1.example.com SEV1 # Main Server External IP--main service Name