千家信息网

heartbeat3.0.4的安装配置方法

发表于:2024-10-25 作者:千家信息网编辑
千家信息网最后更新 2024年10月25日,这篇文章主要介绍"heartbeat3.0.4的安装配置方法",在日常操作中,相信很多人在heartbeat3.0.4的安装配置方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对
千家信息网最后更新 2024年10月25日heartbeat3.0.4的安装配置方法

这篇文章主要介绍"heartbeat3.0.4的安装配置方法",在日常操作中,相信很多人在heartbeat3.0.4的安装配置方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答"heartbeat3.0.4的安装配置方法"的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

(一) 环境说明

操作系统:centos 5.4 x86_64

节点1:

主机名:aos

Ip:xxxxx.82

节点2:

主机名:weibo

Ip:xxxx.82

注意:2个节点都要在各自的hosts文件中指定节点主机名和ip的对应关系,在ha.cf中node参数指定的主机名要和uname -a,host文件里指定的相同

(二) heartbeat3.0组成

heartbeat3.0版本有三部分组成:Heartbeat、Cluster Glue、Resource Agents

1、hearbeat本身是整个集群的基础(cluster messaging layer),负责维护集群各节点的信息以及它们之前通信;
2、cluster-glue相当于一个中间层,可以将heartbeat和crm(pacemaker)联系起来,主要包含2个部分,LRM和STONITH;
3、resource-agent,就是各种的资源的ocf脚本,这些脚本将被LRM调用从而实现各种资源启动、停止、监控等等。

(三) 创建用户和组

[root@aos ha.d]# groupadd haclient

[root@aos ha.d]# useradd hacluster -g haclient -s /sbin/nologin

(四) 安装 ? 安装Cluster-Glue

#tar jvxf Reusable-Cluster-Components-glue--glue-1.0.7.tar.bz2

#cd Reusable-Cluster-Components-glue--glue-1.0.7

#./autogen.sh

#./configure --prefix=/usr/local/ha_soft

#make

#make install

? 安装resource-agent

#cd ..

#tar zvxf ClusterLabs-resource-agents-agents-1.0.4-0-gc06b6f3.tar.gz

#cd ClusterLabs-resource-agents-c06b6f3/

#./autogen.sh

#./configure --prefix=/usr/local/ha_soft CFLAGS=-I/usr/local/ha_soft/include LDFLAGS=-L/usr/local/ha_soft/lib

#cp /usr/local/ha_soft/include/heartbeat/glue_config.h /usr/local/ha_soft/include/heartbeat/glue_config.h.bak

#vi /usr/local/ha_soft/include/heartbeat/glue_config.h(找到如下几个设置项删除对应的行)

HA_SYSCONFDIR

HA_HBCONF_DIR

HA_HBCONF_DIR

#make

#vim /etc/ld.so.conf.d/heartbeat.conf(输入如下行)

/usr/local/ha_soft/lib

#ldconfig

#make install

? 安装heartbeat

#cd ..

#tar jvxf Heartbeat-3-0-STABLE-3.0.4.tar.bz2

#cd Heartbeat-3-0-STABLE-3.0.4

# ./bootstrap

#./configure --prefix=/usr/local/ha_soft CFLAGS=-I/usr/local/ha_soft/include LDFLAGS=-L/usr/local/ha_soft/lib

#cp /srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c /srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c.bak

# vim /srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c(安装源码目录,删除326行)

#make

#make install

(五) 配置(节点1和节点2相同,区别就是检查ip是对方) ? 从源码编译目录中复制配置文件到安装目录

复制附件<配置文件>里的配置文件到 /usr/local/ha_soft/etc/ha.d/

? 编辑ha.cf 主配置文件

[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d

[root@aos ha.d]# vim ha.cf

#debugfile /var/log/ha-debug

#logfile /var/log/ha-log

logfacility local0

keepalive 2

deadtime 6

warntime 4

initdead 30

udpport 694

ucast eth2 192.168.1.200

auto_failback off

node aos

node weibo

compression bz2

compression_threshold 2

ping_group group1 xxxxx82 xxxx.80

respawn root /usr/local/ha_soft/lib/heartbeat/ipfail

apiauth ipfail gid=root uid=root

debug 0

? 编辑authkeys 验证信息文件

[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d

[root@aos ha.d]# vim authkeys

auth 1

1 crc

[root@aos ha.d]# chmod 600 authkeys

? 编辑haresources 资源控制配置文件

[root@aos ha.d]# cd /usr/local/ha_soft/etc/ha.d

[root@aos ha.d]# vim haresources

aos IPaddr::xxxxx.70/25/eht0/xxxxx.127

? 链接文件

[root@aos heartbeat]# vim /etc/ld.so.conf(加入到文件末尾)

/usr/local/ha_soft/lib/

[root@aos heartbeat]# ldconfig

#cp /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs.bak

[root@aos heartbeat]# vim +35 /usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs(注释35行)

(六) 注册并且启动服务

[root@aos ha.d]# chkconfig --add heartbeat

[root@aos ha.d]# chkconfig levles 2345 heartbeat on

[root@aos ha.d]# /etc/init.d/heartbeat start

到此,关于"heartbeat3.0.4的安装配置方法"的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注网站,小编会继续努力为大家带来更多实用的文章!

配置 文件 节点 方法 主机 学习 目录 资源 相同 信息 就是 更多 源码 脚本 集群 帮助 实用 接下来 操作系统 个部 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 武汉宇天互联网科技有限公司 java软件开发招女生么 视觉搜索的数据库 电信服务器需要光猫吗 中小学生网络安全守则口号 南京互联网智慧医院软件开发 广东电脑软件开发服务 网络安全的本质是人才 我的世界能不能把地图变成服务器 两个服务器内存条能一起用吗 软件开发 含税劳务报价 最好的网络安全培训课程 菜鸟网络技术大全 数据库表空间使用率高 jsp定时查询数据库 工业园区数据网络技术包括什么 邯郸网络安全信息化办公室 怎么搜服务器网络地址 数据库哪本书比较好 校园网为什么连接不成服务器 小白测评数据库魅族16s spark服务器配置 软件开发培训能找到工作吗 商务部网络安全学院 石家庄志诚网络技术有限公司 为数字化地图建立地理数据库 我的世界服务器如何设置玩家金钱 服务器ip地址是lp有哪些 重庆木鱼跳跳网络技术怎么样 jsp将数据存入数据库
0