HEartBeat V1 installation configuration

Configuration premise:

1. Time must be synchronized, It is recommended to use ntp protocol

2.Required between nodes To communicate with each other through the host name;The name used in communication must be consistent with the name displayed by the “uname -n” command on the node

3. Arbitration equipment is required< /p>

4. Both root users can communicate based on the ssh key method

5. Local resources must be able to operate normally, this article will use httpd as a case

Note: Any resource defined as a cluster service cannot be started automatically after booting, because they will be started by CRM

Installation method:

< /span>

[root@nod1 heartbeat1]# yum -y install net-snmp-libs libnet PyXML libltdl Pay attention to configure epel source [root@nod1 heartbeat1] #Rpm -ivh heartbeat-2.1.4-12.el6.i686.rpm heartbeat-stonith-2.1.4-12.el6.i686.rpm heartbeat-pils-2.1.4-12.el6.i686.rpm Preparing.. ########################################[100%] 1: heartbeat-pils ########################################[ 33%] 2:heartbeat-stonith ######################################## [67 %] 3: heartbeat ######################################[100 %]

< span style="font-size:14px;line-height:21px; ">

Sync time:

 crontab */3 ** ** /usr/sbin/ntpdate 172.16.0.1 &> /dev/null

Node 1: Establish encryption association

ssh -keygen -P''ssh-copey-id -i.ssh/id_rsa.pub root@node2
[root@nod1 ~]#ssh nod2'date';date keep Time synchronization between two nodes Mon Oct 5 17:38:47 HKT 2015 Mon Oct 5 17:38:47 HKT 2015
[root@nod1 ~]#scp /etc/hosts nod2:/ etc/hosts The hosts files of the two nodes are consistent. hosts The files of the two nodes are consistent. The hosts file is consistent with the hosts. The hosts file is consistent with the hosts. The hosts file is consistent with the host files. The hosts file of the two nodes is consistent. The hosts file is consistent with the hosts of the two nodes. The fonts of the two nodes are pretty much the same. 'Liberation Mono', Menlo, Courier, monospace;background-color:rgb(247,247,249);padding:10px;border:1px solid rgb(225,225,232);">[root@nod2~]#ssh-keygen-trsa-P '' Ensure that nod2 is encrypted to connect to nod1Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): Your identification has been sa in/root/ved_rsa Your identity has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:b0:bc:2e:44:88:6e:7b:a7:d0:63:f6:9f:4f:f8:4d:55 [email protected] key's randomart image is:+--[RSA 2048]----+| .|| o.......................,..,.,;.,;. -----+[root@nod2~]# ssh-copy-id -i.ssh/id_rsa.pub root@nod1The authentication of host'nod1 (192.168.1.10)' can't be established. RSA key fingerprint is 41:26:a8:88:6a:93:f6:56:aa:87:6b:d7:62:46:83:0d.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'nod1,192.168.1.10' (RSA) to the list of known hosts.root@nod1's password: Now try logging into the machine, with "ssh'root@nod1'", and check in: ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting. [root@nod2 ~]# ssh nod1'date';dateMon Oct 5 17:45:26 HKT 2015Mon Oct 5 17:45:26 HKT 2015

Configuration file settings;

cd /usr/share/doc/heartbeat-2.1.4cp -p authkeys haresources ha.cf /etc/ha.d #Copy the backup configuration file to the configuration directory ha.cf: the main configuration file of heartbeat, authkeys: cluster information encryption algorithm and key, haresources: heartbeat v1 CRM configuration interface cd /etc/ha.d/chmod 600 authkeys Modify permission 400 or 600

Modify ha.cf configuration:

vim Ha.cflogfile /var/log/ ha-log#logfacility local0mcast eth0 228.203.101.1 694 1 0 Use multicast address, local multicast address: 239.0.0.0-239.255.255.255, only valid in a specific local range node nod1.mageedu.comnode nod2.mageedu.com The computer that joins the high-availability cluster ping 192.168.1.1 arbitration equipment, the standard to judge whether the computer is available compression bz2 select compression
 vim authkeys auth 1 set encryption, you can use openssl rand -hex 6 Generate encrypted password

< /p>

 vim haresouces: nod1.mageedu.com 192.168.1.15/24/eth0/192.168.1.255 httpd The Haresources file is used to specify the master node, cluster IP, and subnet mask of the two-machine system Cluster resources such as codes, broadcast addresses, and started services
scp-p authkeys haresouces ha.cf node2:/etc/ha.d/ Ensure that the host 2 is configured with the same file attributes -P
service heartbeart start; ssh node2'service heartbeat start' to start the service, access to the external network address can be accessed normally

tail /var/log/ha-log view log
 cd /usr/lib64/heartbeat/. /hb_standby is not the main one. /hb_takeover is used for the main resource conversion

Leave a Comment

Your email address will not be published.