小雨点点789 发表于 2019-1-7 08:16:07

Linux平台-源码安装heartbeat 3.0集群

  一,前期准备
  1、Heartbeat集群必须的硬件
  构建一个Heartbeat集群系统必须的硬件设备有:
  节点服务器、网络和网卡、共享磁盘
  2、操作系统规划
  每个节点服务器都有两块网卡,一块用作连接公用网络,另一块通过以太网交叉线连接两个节点,作为心跳监控
  3,ip规划
  节点类型
  ip地址
  主机名
  类型
  主节点(rhel 5.5)
  eth0:18.1.30.60
  priv3.wolf.org
  private
  eth1:192.168.87.130
  test3.wolf.org
  public
  eth1:0192.168.87.100
  virtual
  备用节点(rhel 6.0)
  eth0:18.1.30.61
  priv4.wolf.org
  private
  eth1:192.168.87.144
  test4.wolf.org
  public
  4,域名解析
  # vim/etc/hosts
  127.0.0.1            localhost.localdomain localhost
  18.1.30.60             priv3.wolf.org    priv3
  18.1.30.61             priv4.wolf.org    priv4
  192.168.87.130         test3.wolf.org    test3
  192.168.87.144         test4.wolf.org    test4
  5,所必须的软件包
  yum install -y libxml2libxml2-develbzip2-devel glib2-devel gettext intltool autoconf automake libtool-ltdl-devellibuuid-develpkgconfig libxslt-devellibtool
  二、安装heartbeat
  这里的安装以heartbeat3.x为讲解对象,以下操作需要在两个节点都进行安装,基本安装过程为:
  首先建立相关用户hacluster和组haclient,然后设定环境变量,最后就是安装heartbeat,过程如下:
  1、添加用户和组
  groupadd haclient
  useradd -g haclient hacluster
  2、设置环境变量
  vi /root/.bash_profile,添加如下内容:
  export PREFIX=/usr/local/ha
  export LCRSODIR=$PREFIX/libexec/lcrso
  export CLUSTER_USER=hacluster
  export CLUSTER_GROUP=haclient
  export CFLAGS="$CFLAGS -I$PREFIX/include-L$PREFIX/lib"
  getent group ${CLUSTER_GROUP} >/dev/null|| groupadd -r ${CLUSTER_GROUP}
  getent passwd ${CLUSTER_USER} >/dev/null|| useradd -r -g ${CLUSTER_GROUP} -d /var/lib/heartbeat/cores/hacluster
  -s /sbin/nologin -c "clusteruser" ${CLUSTER_USER}
  heartbeat3.x版本把安装包分成了4个部分,分别是:ClusterGlue、Resource Agents、heartbeat和pacemaker,所以要分别安装,可以从http://hg.linux-ha.org、http://hg.clusterlabs.org下载对应的软件包,这里使用的软件版本分别为:
  glue-1.0.9、ClusterLabs-resource-agents-v3.9.2-0-ge261943.tar、heartbeat-STABLE-3.0.4、Pacemaker-1.0.10
  1)安装Cluster Glue
  tar jxvfReusable-Cluster-Components-glue--glue-1.0.9.tar.bz2
  cd Reusable-Cluster-Components-glue--glue-1.0.9.tar.bz2
  ./autogen.sh
  ./configure --prefix=$PREFIX--with-daemon-user=${CLUSTER_USER}--with-daemon-group=${CLUSTER_GROUP} --enable-fatal-warnings=no
  make
  make install
  注意:
  (1)报错出现configure:WARNING: no configuration information is in libltdl 说明有软件包没有装这个软件包就是 libtool-ltdl-devel
  2)安装Resource Agents
  tar jxvfCluster-Resource-Agents-5ae70412eec8.tar.bz2
  cd Cluster-Resource-Agents-5ae70412eec8
  ./autogen.sh
  ./configure--prefix=$PREFIX --enable-fatal-warnings=no
  make
  make install
  3)安装heartbeat
  tar jxvf Heartbeat-3-0-fcd56a9dd18c.tar.bz2
  cd Heartbeat-3-0-fcd56a9dd18c
  ./bootstrap
  ./configure--prefix=$PREFIX --enable-fatal-warnings=no
  make
  make install
  4)安装pacemaker
  tar jxvfPacemaker-1-0-c3869c00c759.tar.bz2
  cd Pacemaker-1-0-c3869c00c759
  ./autogen.sh
  ./configure --prefix=$PREFIX--with-lcrso-dir=$LCRSODIR--enable-fatal-warnings=no
  make
  make install
  5)安装图像管理工具Pacemaker-Python-GUI
  tar jxvfPacemaker-Python-GUI-18332eae086e.tar.bz2
  cd Pacemaker-Python-GUI-18332eae086e
  ./bootstrap--prefix=$PREFIXCFLAGS="$CFLAGS -I$PREFIX/include -L$PREFIX/lib64"
  make
  make install
  可能出现如下报错:aclocal:configure.in:57: warning: macro `AM_PO_SUBDIRS' not found inlibrary ./configure: line 2064: syntax error near unexpected token `0.35.2'./configure: line 2064: `AC_PROG_INTLTOOL(0.35.2)‘只需安装gettext和intltool软件包即可
  三,安装排错
  1、libtoolize:`COPYING.LIB' not found in `/usr/share/libtool/libltdl'
  解决办法:
  yum -y install libtool-ltdl-devel
  2、checking forspecial libxml2 includes... configure: error: libxml2 config not found
  解决办法:
  yum -y install libxml2
  3、configure:error: BZ2 libraries not found
  解决办法:
  yum -y install bzip2-devel glib2-devel
  前三种感觉是常识性问题,各位如果经常安装源码包的话这种错误解决起来应该很easy的。
  4、安装Reusable-Cluster-Components-glue--glue-1.0.9
  ./.libs/libplumb.so: undefined reference to`uuid_parse’
  ./.libs/libplumb.so: undefined reference to`uuid_generate’
  ./.libs/libplumb.so: undefined reference to`uuid_copy’
  ./.libs/libplumb.so: undefined reference to`uuid_is_null’
  ./.libs/libplumb.so: undefined reference to`uuid_unparse’
  ./.libs/libplumb.so: undefined reference to`uuid_clear’
  ./.libs/libplumb.so: undefined reference to`uuid_compare’
  collect2: ld returned 1 exit status
  gmake: *** Error 1
  gmake: Leaving directory`/root/Reusable-Cluster-Components-glue-1.0.6/lib/clplumbing’
  gmake: *** Error 1
  gmake: Leaving directory`/root/Reusable-Cluster-Components-glue-1.0.6/lib’
  make: *** Error 1
  解决办法:
  ./configure --prefix=$PREFIX --with-daemon-user=${CLUSTER_USER} --with-daemon-group=${CLUSTER_GROUP}--enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'
  各位在./configure的时候指定一下LIBS,如果是32位系统的话改成LIBS='/lib/libuuid.so.1'。下面ClusterLabs-resourceHeartbeat在./configure的时候都指定一下,要不然继续报错。
  5、
  uuid_parse.c:250: error: expected ‘;’, ‘,’ or ‘)’ before ‘uu’
  uuid_parse.c:469: error: expected ‘)’ before ‘out’
  uuid_parse.c:484: error: expected ‘)’ before ‘out’
  uuid_parse.c:512: error: expected ‘)’ before ‘out’
  gmake: *** Error 1
  gmake: Leaving directory`/usr/src/Heartbeat-3-0-7e3a82377fa8/replace'
  make: *** Error 1
  解决办法:
  # ./configure --prefix=$PREFIX--enable-fatal-warnings=no LIBS='/lib64/libuuid.so.1'
  6,
  gmake: --xinclude: Command not found
  gmake: *** Error 127
  gmake: Leaving directory`/usr/src/Heartbeat-3-0-7e3a82377fa8/doc'
  make: *** Error 1
  解决办法:
  # yum -y install libxslt-devel
  7,
  error : Operation in progress
  warning: failed to load external entity"http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl"
  compilation error: filehttp://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl line 46element include
  xsl:include : unable to load http://docbook.sourceforge.net/release/xsl/current/html/formal.xsl
  http://docbook.sourceforge.net/release/xsl/current/html/table.xsl:1:parser error : Document is empty
  http://docbook.sourceforge.net/release/xsl/current/html/table.xsl:1:parser error : Start tag expected, '
页: [1]
查看完整版本: Linux平台-源码安装heartbeat 3.0集群