编译安装heartbeat3.0.9

编译安装heartbeat3.0.9

   张吉吉     2019年12月17日 02:34     1616    

1、安装依赖环境

yum install -y bzip2 autoconf automake libtool glib2-devel libxml2-devel bzip2-devel libtool-ltdl-devel asciidoc libuuid-devel

 

2、下载相关软件

heartbeat:

wget http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/958e11be8686.tar.bz2

glue:

wget http://hg.linux-ha.org/glue/archive/0a7add1d9996.tar.bz2

resource-agent:

wget https://github.com/ClusterLabs/resource-agents/archive/v3.9.6.tar.gz

 

3、创建属主属组

groupadd haclient

useradd -g haclient hacluster -M -s /sbin/nologin

 

4、安装glue

./autogen.sh

./configure --prefix=/usr/local/shopnc/heartbeat/ --sysconfdir=/usr/local/shopnc/heartbeat/etc/ libdir=/usr/local/shopnc/heartbeat/lib64 LIBS='/lib64/libuuid.so.1'

make

make install

 

5、安装resource-agent

./autogen.sh

export CFLAGS="$CFLAGS -I/usr/local/shopnc/heartbeat/include -L/usr/local/shopnc/heartbeat/lib64"

cd resource-agents-3.9.6/

ln -s/usr/local/shopnc/heartbeat/lib64/* /lib64/

ln -s /usr/local/shopnc/heartbeat/lib64/* /lib/

./configure --prefix=/usr/local/shopnc/heartbeat/ --sysconfdir=/usr/local/shopnc/heartbeat/etc/ libdir=/usr/local/shopnc/heartbeat/lib64 LIBS='/lib64/libuuid.so.1'

make

make install

 

6、安装heartbeat

./bootstrap

./configure --prefix=/usr/local/shopnc/heartbeat/ --sysconfdir=/usr/local/shopnc/heartbeat/etc/ libdir=/usr/local/shopnc/heartbeat/lib64 LIBS='/lib64/libuuid.so.1'

vim /usr/local/shopnc/heartbeat/include/heartbeat/glue_config.h

make

make install

 

7、复制配置文件

cp /usr/local/shopnc/heartbeat/share/doc/heartbeat/ha.cf /usr/local/shopnc/heartbeat/etc/ha.d/

cp /usr/local/shopnc/heartbeat/share/doc/heartbeat/authkeys /usr/local/shopnc/heartbeat/etc/ha.d/

cp /usr/local/shopnc/heartbeat/share/doc/heartbeat/haresources /usr/local/shopnc/heartbeat/etc/ha.d/

 

8、修改配置文件

(1)vim /usr/local/shopnc/heartbeat/etc/ha.d/authkeys

auth 3

3 md5 密码

这个配置文件表示发送心跳时,机器验证key的hash算法,双方必须一致

chmod 600 /usr/local/shopnc/heartbeat/etc/ha.d/authkeys

 

(2)vim /usr/local/shopnc/heartbeat/etc/ha.d/haresources

该文件表示资源的管理,如果是主机,当主机启动后,自动加载该文件中配置的所有启动资源

master 192.168.0.224/24/enp0s31f6:0 redis

 

(3)vim /usr/local/shopnc/heartbeat/etc/ha.d/ha.cf

debugfile /var/log/ha-debug

logfile /var/log/ha-log

logfacility local0

keepalive 2

deadtime 30

warntime 10

initdead 60

udpport 694

ucast enp0s31f6 192.168.0.217

auto_failback on

node slave

 

文章评论

0

其他文章