CentOS编译安装Heartbeat

安装cluster glue

安装heartbeat之前需要安装glue。

  1. yum install autoconf automake libtool glib2-devel libxml2-devel bzip2-devel e2fsprogs-devel libxslt-devel
  2. groupadd haclient
  3. useradd -g haclient hacluster
  4. cd /tmp
  5. wget http://hg.linux-ha.org/glue/archive/glue-1.0.9.tar.bz2
  6. tar xjf glue-1.0.9.tar.bz2
  7. cd Reusable-Cluster-Components-glue--glue-1.0.9
  8. ./autogen.sh
  9. ./configure --prefix=/usr/local/heartbeat
  10. make && make install

安装Resource Agents

  1. cd /tmp
  2. wget --no-check-certificate https://github.com/ClusterLabs/resource-agents/tarball/v3.9.2
  3. tar xzf v3.9.2
  4. cd ClusterLabs-resource-agents-b735277/
  5. ./autogen.sh
  6. export
  7. ./configure --prefix=/usr/local/heartbeat
  8. ln -s  /usr/local/heartbeat/lib/* /lib/
  9. make && make install

安装Heartbeat

  1. cd /tmp
  2. wget http://hg.linux-ha.org/heartbeat-STABLE_3_0/archive/7e3a82377fa8.tar.bz2
  3. tar xjf 7e3a82377fa8.tar.bz2
  4. cd Heartbeat-3-0-7e3a82377fa8/
  5. ./bootstrap
  6. export
  7. ./configure --prefix=/usr/local/heartbeat
  8. make && make install
  9. cp doc/ha.cf /usr/local/heartbeat/etc/ha.d/
  10. cp doc/haresources /usr/local/heartbeat/etc/ha.d/
  11. cp doc/authkeys /usr/local/heartbeat/etc/ha.d/
  12. cp heartbeat/init.d/heartbeat /etc/rc.d/init.d/
  13. chkconfig --add heartbeat
  14. chkconfig heartbeat on
  15. chmod 600 /usr/local/heartbeat/etc/ha.d/authkeys
  16. sed -i 's#/usr/lib/ocf#/usr/local/heartbeat/usr/lib/ocf#g' /usr/local/heartbeat/etc/ha.d/shellfuncs
  17. sed -i 's#/usr/lib/ocf#/usr/local/heartbeat/usr/lib/ocf#g' /usr/local/heartbeat/usr/lib/ocf/lib//heartbeat/ocf-shellfuncs
  18. sed -i 's#/usr/lib/ocf#/usr/local/heartbeat/usr/lib/ocf#g' /usr/local/heartbeat/etc/ha.d/resource.d//hto-mapfuncs

除错

1、错误:glue_config.h:99:1: error: “HA_HBCONF_DIR” redefined
解决方法:https://www.centos.bz/2012/02/glue_config-h991-error-ha_hbconf_dir-redefined/
2、错误configure.ac:9: error: Autoconf version 2.63 or higher is required
解决方法:https://www.centos.bz/2012/03/configure-ac9-error-autoconf-version-2-63-or-higher-is-required/
3、错误configure.ac:63: require Automake 1.10.1, but have 1.9.6
解决方法:https://www.centos.bz/2012/03/configure-ac63-require-automake-1-10-1-but-have-1-9-6/

标签:Centos 发布于:2019-11-24 07:13:38