centos6.x下yum安装heartbeat

[[email protected] ~]# uname -n   #<===配置heartbeat时,节点的主机名必须和 uname -n 命令的结果要一致
heartbeat
[[email protected] ~]# crontab -l  #<===时间同步很重要
#ntpdate by root
*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null
[[email protected] ~]# release=`grep -o "[0-9]" /etc/redhat-release | head -1`
[[email protected] ~]# cat <<eof>/etc/yum.repos.d/epel.repo
> [epel]
> name=epelrepo
> baseurl=https://mirrors.aliyun.com/epel/${release}Server/\$basearch
> gpgcheck=0
> enable=1
> eof
[[email protected] ~]# yum -y install heartbeat      #<===centos6.x下yum默认安装heartbeat版本是3.0.4,centos7.x下只能编译安装
[[email protected] ~]# cd /usr/share/doc/heartbeat-3.0.4/
[[email protected] heartbeat-3.0.4]# cp {ha.cf,haresources,authkeys} /etc/ha.d/
[[email protected] heartbeat-3.0.4]# cd /etc/ha.d/
[[email protected] ha.d]# chmod 600 /etc/ha.d/authkeys
[[email protected] ha.d]# ip addr add 10.0.0.30/24 broadcast 10.0.0.255 dev eth0   #<===添加辅助VIP
[[email protected] ha.d]# cat ha.cf
#configure start by root
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local1

keepalive 2
deadtime 30
warntime 10
initdead 60

#bcast eth1
mcast eth0 225.0.0.20 694 1 0

auto_failback on
node heartbeat
#node heartbeat2
crm no

#configure end by root
[[email protected] ha.d]# cat authkeys
auth 1
1 sha1 LfW+BX0CQVLls1hrumK9ejVCcfk=
[[email protected] ha.d]# cat haresources
#config by root
heartbeat IPaddr::10.0.0.30/24/eth0
#heartbeat2 IPaddr::10.0.0.60/24/eth0
[[email protected] ha.d]# ll /etc/init.d/heartbeat
-rwxr-xr-x. 1 root root 10485 Dec 3 2013 /etc/init.d/heartbeat
[[email protected] ~]# /etc/init.d/heartbeat start
Starting High-Availability services: INFO: Resource is stopped
Done.
[[email protected] ~]# netstat -lntup|grep heartbeat
udp 0 0 0.0.0.0:35586 0.0.0.0:* 1525/heartbeat: wri
udp 0 0 225.0.0.20:694 0.0.0.0:* 1525/heartbeat: wri
[[email protected] ha.d]# chkconfig --add heartbeat
[[email protected] ha.d]# chkconfig --level 3 heartbeat on

以上是单台heartbeat服务器配置,生产中双机热备heartbeat配置文件{ha.cf,authkeys,haresources}内容是一样的,这里心跳线配置步骤省略....

如遇安装报错,查看 /var/log/ha-log日志排查错误即可,heartbeat相对来说还是简单的。

更多详细知识参考好友博客 http://www.cnblogs.com/f-ck-need-u/p/8587882.html

原文地址:https://www.cnblogs.com/blog-tim/p/10764280.html

时间: 2024-10-10 03:33:38

centos6.x下yum安装heartbeat的相关文章

centos6.5下yum安装lnmp(适合刚入职的新手的方法)

新入职的员工,开始的时候都是让配环境,本地写代码用的wamp,在lnmp或lamp测试,除非有些土豪公司 用的是(果机). 另外安装时,把整个流程在脑子里先过一篇(记不全也没关系,一回生二回熟),重在实践,实践出真知! 一:首先要在自己电脑安装一个虚拟主机软件,我这有: vmware10 ---> 网盘地址:http://pan.baidu.com/s/1pJt5HVl centos6.5(32位):网盘地址:http://pan.baidu.com/s/1pJqNLxD xshell4:  网

centos6.5下yum安装mysql5.5

第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了mysql5.1,那就开始卸载咯 2 接下来就是卸载mysql5.1了,命令:rpm -e mysql-libs --nodeps   yum中之后mysql5.1,安装还是5.1,现在就要去增加一个新的repo rpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm   一共需要增加两个re

Centos6.8下yum安装python2.7

下载 ius-release.rpm包 wget https://centos6.iuscommunity.org/ius-release.rpm 安装ius-release.rpm包 rpm -Uvh ius-release.rpm 安装python27版本 yum install python27 python27-devel python27-pip 原文地址:https://www.cnblogs.com/yahengwang/p/9603868.html

centos下yum安装lamp和lnmp轻松搞定

centos下yum安装lamp和lnmp轻松搞定,到底多轻松你看就知道了,妈妈再也不担心不会装lamp了. 很辛苦整理的安装方法,会持续更新下去.凡无法安装的在评论里贴出问题来,会尽快解决.共同维护一个可用yum可用更新. 软件列表:php5.4 apache2.2 mysql5.5 nginx1.8 centos6.x rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ng

CentOS6.3下DNS安装与配置

1.下载并安装最新的bind包 yum install –y bind bind-chroot bind-utis 2.配置named.conf acl internals{ 127.0.0.0/8; 192.168.0.0/24; }; view "internal" { match-clients {internals; }; zone "youdomian.com" { type master; file "/etc/named/internals/

centos6.7下编译安装lnmp

很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y groupinstall "Development Tools" "Server Platform Development" yum -y install pcre-devel  useradd -r nginx  mkdir /var/tmp/nginx   事先得创建

centos6.7下 编译安装MySQL5.7

centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ncurses-devel cmake make perl gcc autoconf automake zlib libxml libgcrypt libtool bison #获取boost类库(5.7编译需要boost类库,编译时指定boost路径): shell> wget http://down

CentOS6.5下Oracle11G-R2安装、卸载

资源下载地址(包括本人所有安装过程中,系统备份文件):http://download.csdn.net/detail/attagain/7700437 一. 硬件要求 本部分内容命令,均以root用户执行. 1. 内存 建议内存应大于2G以上,1G可以运行,但比较吃力. 内存查看命令: [[email protected] /]# cat /proc/meminfo 或 [[email protected] /]# free -m total       used       free    

Centos6.4下Nginx安装

Nginx ("engine x") 是一个高性能的 HTTP 和反向代理服务器,也是一个 IMAP/POP3/SMTP 代理服务器. Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,它已经在该站点运行超过三年了.Igor 将源代码以类BSD许可证的形式发布. Nginx和Apache区别 Nginx 超越 Apache 的高性能和稳定性,使得国内使用 Nginx 作为 Web 服务器的网站也越来越多,其中包括新浪博客.新浪播客.网易新