共计 2968 个字符,预计需要花费 8 分钟才能阅读完成。
1. 首先建立相关用户 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 “cluster user” ${CLUSTER_USER}
heartbeat3.x 版本把安装包分成了 4 个部分,分别是:Cluster Glue、Resource Agents、heartbeat 和 pacemaker,所以要分别安装
glue 下载地址: http://hg.linux-ha.org/glue
2. 编译安装 glue
tar –xjvf Reusable-Cluster-Components-glue–5e06b2ddd24b.tar.bz2
cd Reusable-Cluster-Components-glue–5e06b2ddd24b
./autogen.sh
./configure –prefix=$PREFIX –with-daemon-user=${CLUSTER_USER} –with-daemon-group=${CLUSTER_GROUP} –enable-fatal-warnings=no
make
make install
3. 编译安装 Agent
tar jxvf Cluster-Resource-Agents-5ae70412eec8.tar.bz2
cd Cluster-Resource-Agents-5ae70412eec8
./autogen.sh
./configure –prefix=$PREFIX –enable-fatal-warnings=no
make
make install
4. 编译安装 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
5. 编译安装 Pacemaker
没有成功,最后一个错误没有能够解决,求指导!
过程中出现错误汇总:
checking for special libxml2 includes… configure: error: libxml2 config not found
解决方法:
sudo apt-get install libxml2-dev
configure: error: BZ2 Development headers not found
解决方法:
sudo apt-get install libbz2-dev
./.libs/libplumb.so: undefined reference to `uuid_clear’
./.libs/libplumb.so: undefined reference to `uuid_unparse’
./.libs/libplumb.so: undefined reference to `uuid_copy’
./.libs/libplumb.so: undefined reference to `uuid_compare’
./.libs/libplumb.so: undefined reference to `uuid_is_null’
./.libs/libplumb.so: undefined reference to `uuid_generate’
./.libs/libplumb.so: undefined reference to `uuid_parse’
解决方法:
sudo apt-get install uuid-dev
./configure –prefix=$PREFIX –with-daemon-user=${CLUSTER_USER} –with-daemon-group=${CLUSTER_GROUP} –enable-fatal-warnings=no LIBS=’/lib/x86_64-linux-gnu/libuuid.so.1′
a2x -f manpage hb_report.8.txt
make[2]: a2x: Command not found
解决方法:
sudo apt-get install asciidoc
configure: error: The libxslt developement headers were not found
解决方法:
sudo apt-get install libxslt1-dev
checking main() in -lplumb…no
解决方法:
sudo apt-get install libplumb2-dev
../lib/pengine/.libs/libpe_status.so: undefined reference to `stdscr’
../lib/pengine/.libs/libpe_status.so: undefined reference to `wmove’
../lib/pengine/.libs/libpe_status.so: undefined reference to `printw’
一直没找到答案,求大神指导!
推荐阅读 :
Linux 高可用(HA)集群之 heartbeat 基于 crm 进行资源管理详解 http://www.linuxidc.com/Linux/2013-08/89167.htm
Heartbeat+httpd+NFS 实现高可用的 Web 服务器 http://www.linuxidc.com/Linux/2013-08/88520.htm
Linux 高可用(HA)集群之 Heartbeat 详解 http://www.linuxidc.com/Linux/2013-08/88521.htm
Linux 高可用性方案之 Heartbeat 的 CRM 配置 http://www.linuxidc.com/Linux/2012-05/60838.htm
高可用集群 Heartbeat v1 实例 http://www.linuxidc.com/Linux/2013-09/90757.htm
更多 Ubuntu 相关信息见 Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2