To build a centos with heartbeat to realize the hot standby of two machines

Source: Internet
Author: User
Keywords Linux

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
Related Article

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.