HA high-availability cluster and HA Available Cluster

Source: Internet
Author: User

HA high-availability cluster and HA Available Cluster
Prepare two machines:
Master: 192.168.254.140
Slave: 192.168.254.141vim/etc/hosts master, slave: 192.168.254.140 master192.168.254.141 slave
1. Master and master installation:
Wget www.lishiming.net/data/attachment/forum/epel-release-6-8_64.noarch.rpm
Rpm-ivh epel-release-6-8_64.noarch.rpm
Yum install-y libnetyum install-y heartbeat
2. Edit the three configuration files of HA on the master.
Cd/usr/share/doc/heartbeat-3.0.4/
Cp authkeys ha. cf haresources/etc/ha. d/
Cd/etc/ha. d/
Vim authkeys

Chmod 600 authkeys
Vim haresources the ip address here is vip:
The following configuration file is different between the master and slave nodes:
Vim ha. cf

Debugfile/var/log/ha-debug
Logfile/var/log/ha-log
Logfacility local0
Keepalive 2
Deadtime 30
Warntime 10
Initdead 60
Udpport 649
Ucast eth0 192.168.254.141 # Here, the ip address is the ip address of the other Party. If it is from 140
Auto_failback on
Node master
Node slave
Ping 192.168.1.1
Respawn hacluster/usr/lib64/heartbeat/ipfail

3. Copy three configurations to the top
Yum install openssh-clients # scp installation package scp authkeys haresources ha. cf slave:/etc/ha. d/# All three configurations are vim ha copied from the master. cfdebugfile/var/log/ha-debug
Logfile/var/log/ha-log
Logfacility local0
Keepalive 2
Deadtime 30
Warntime 10
Initdead 60
Udpport 649
Ucast eth0 192.168.254.140 # Here, the ip address of the other party is 140.
Auto_failback on
Node master
Node slave
Ping 192.168.1.1
Respawn hacluster/usr/lib64/heartbeat/ipfail
4. Start (Master first and slave)
/Etc/init. d/heartbeat start

5. Test
MASTER:
Echo "11111111111111111 master">/usr/share/nginx/html/index.html
Iptables-a input-p icmp-j DROP
Iptables-d input-p icmp-j DROP
/Etc/init. d/heartbeat stop
From:
Echo "2222222222222 slave">/usr/share/nginx/html/index.html



 

 



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.