两台机器测试的话配置的前提
关闭防火墙和selinux
两台机能基于主机名进行互相ip解析,即修改hosts文件
两台机能基于主机名进行ssh无密码登陆,ssh-keygen和ssh-copy-id
两台机时间同步,如用ntpdate命令同步同一个时间服务器
安装heartbeat步骤如下
http://linux-ha.org/wiki/Download 安装包包的下载地址
yum -y install gcc gcc-c++ autoconf automake libtool glib2-devel libxml2-devel bzip2 bzip2-devel e2fsprogs-devel libxslt-devel libtool-ltdl-devel asciidoc
yum -y install psmisc 不安装的话,后面配置文件中配置自动挂载时会报错(Setup problem: couldn't find command: fuser)
yum -y install net-tools 不装在haresources使用IPaddr会报错
groupadd haclient
useradd -g haclient hacluster
tar xf 0a7add1d9996.tar.bz2
cd Reusable-Cluster-Components-glue--0a7add1d9996/
./autogen.sh
./configure --prefix=/usr/local/heartbeat --with-daemon-user=hacluster --with-daemon-group=haclient --enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'
make && make install
cd
tar xf resource-agents-3.9.6.tar.gz
cd resource-agents-3.9.6/
./autogen.sh
./configure --prefix=/usr/local/heartbeat --with-daemon-user=hacluster --with-daemon-group=haclient --enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'
make && make install
cd
tar xf 958e11be8686.tar.bz2
cd Heartbeat-3-0-958e11be8686/
./bootstrap
export CFLAGS="$CFLAGS -I/usr/local/heartbeat/include -L/usr/local/heartbeat/lib"
./configure --prefix=/usr/local/heartbeat --with-daemon-user=hacluster --with-daemon-group=haclient --enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'
make && make install
cp doc/{ha.cf,haresources,authkeys} /usr/local/heartbeat/etc/ha.d/
chmod 600 /usr/local/heartbeat/etc/ha.d/authkeys
mkdir -pv /usr/local/heartbeat/usr/lib/ocf/lib/heartbeat/
cp /usr/lib/ocf/lib/heartbeat/ocf-* /usr/local/heartbeat/usr/lib/ocf/lib/heartbeat/
ln -svf /usr/local/heartbeat/lib64/heartbeat/plugins/RAExec/* /usr/local/heartbeat/lib/heartbeat/plugins/RAExec/
ln -svf /usr/local/heartbeat/lib64/heartbeat/plugins/* /usr/local/heartbeat/lib/heartbeat/plugins/
定义配置文件后再启动(配置文件目录为/usr/local/heartbeat/etc/ha.d/)
chkconfig --add heartbeat
systemctl start heartbeat.service
Centos7安装heartbeat
最新推荐文章于 2023-01-08 16:55:24 发布