Heartbeat Installation and Simple configuration

Source: Internet
Author: User
Tags sha1

1. Create users and groups [[email protected] ~]# groupadd-g 694 haclient[[email protected] ~]# useradd-u 694-g haclient hacluster

2, Heartbeat installation1) Install libnet[[email protected] software]# pwd/tmp/software[[email protected] software]# ll Total 4200-rw-r–r–1 Root root 3267773 08-16 18:51 heartbeat-2.0.8.tar.gz-rw-r–r–1 root root 1021236 08-16 18:51 libnet-1.1.2.1.tar.gz[[email& Nbsp;protected] software]# tar XF libnet-1.1.2.1.tar.gz[[email protected] sofeware]# CD libnet[[email  Protected] sofeware]#./configure[[email protected] sofeware] #make [[email protected] sofeware] #make INSTALL2) Install heartbeat[[email protected] software]# tar XF heartbeat-2.0.8.tar.gz[[email protected] sofeware]# CD heartbeat-2.0.8[[email protected] Heartbeat-2.0.8]#./configureme Configure–disable-swig  – Disable-snmp-subagent[[email protected] heartbeat-2.0.8] #make [[email protected] heartbeat-2.0.8] #make Install[[email protected] heartbeat-2.0.8]# cp doc/ha.cf Doc/authkeys doc/haresources/etc/ha.d/# Heartbeat's main configuration file has Ha.cf,authkeys and Haresources, after the heartbeat installation, the default does not have these 3 files, can be downloaded from the official website, can also be found from the extracted source directory, so we here directly inCopy in the source directory. 3, modify parameters 1) ha.cf#logfacility     local0                 #可注释掉此选项, open the following log path; Logfil E        /var/log/ha-log           #设置heartbeat日志存放位置; keepalive 2 #设定心跳 (monitoring) time Time is 2 seconds, warntime 5 #连续多长时间联系不上后开始警告提示;d eadtime #连续多长时间联系不上后认为对方挂掉了 (unit is wonderful); Initdead 120 # Here is mainly to the restart after the reservation of a period of time to ignore (such as: Restart after the network, etc., if the network has not pass, keepalive detection is sure to pass, but at this time can not switch), this value is at least twice times deadtime; Udpport 694 #设置广播通信的端口, The default is 694;baud 19200         #设置串行通讯的波特率; Bcast eth1 #指明心跳使用以太网的广播方式 and broadcast on eth1; Ucast   eth1 10.10.10.2   #单播 (broadcast, unicast select one) auto_failback off #恢复正常后是否需要再自动切换回来, where off indicates that no switchover is required after recovery; node Node1         #主节点主机名, can be viewed through "uname-n", node node2     #备用节点主机名; ping 192.168.0.254 #测试网络连通性, customized here, generally set as gateway address, but guaranteed to be ; respawn Hacluster/usr/lib/heartbeat/ipfail #可选, lists the processes that are started and closed together with Heartbeat; 2) Haresourcesnode1 ipaddr::192.168.1.100/ 24/eth0/filesystem::/dev/sdc1::/shared::ext3 cupsnode-name Resource1 resource2 ... resourcen where Node-naThe Me is the name of a node in the cluster and must be the same as uname–n, followed by the resource group Resource1 Resource2 ... each resource in the Resourcen is a shell script with a search path of/etc/init.d/and/usr/ LOCAL/ETC/HA.D/RESOURCE.D (this path differs depending on the path of the heartbeat you have installed), Heartbeat provides us with a very good resource extension framework, if we need to control a resource of our own, Just implement a shell script that supports the start and stop parameters, and the resource scripts currently supported by Heartbeat can be viewed in the above path I provide. 1) The first column of the resource group is one of our nodes in the HA.CF configuration file, and should be the one that is currently being prepared as the primary node, and each row represents a resource group, and if one line can not be used to "" Wrap, 3) the resource group start order is from left to right, The order of closing is from right to left; 4) The parameters of the script are separated and passed by:: 5) A resource group is separated by a space between different resources, 6) There is no inevitable relationship between different resource groups; 7) Each resource is a corner book, either under the/ETC/INIT.D directory or/usr/ LOCAL/ETC/HA.D/RESOURCE.D the bottom of the catalogue. These horns must support XXX start;xxx stop; mode;

3) Authkeys[[email protected] ~]# Vim/etc/ha.d/authkeysauth Crc[[email protected] ~] #chmod 600/etc/ha.d/ Authkeys if we want to adopt the SHA1 algorithm, we just need to change the auth instruction (minus the comment) in the Authkeys to 2, while the corresponding 2 SHA1 line needs to remove the comment (#) and the following key will change itself (must be the same on the two node)

Heartbeat Installation and Simple configuration

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.