centos6.x下yum安装heartbeat
[root@heartbeat ~]# uname -n #<===配置heartbeat时,节点的主机名必须和 uname -n 命令的结果要一致
heartbeat
[root@heartbeat ~]# crontab -l #<===时间同步很重要
#ntpdate by root
*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com &>/dev/null
[root@heartbeat ~]# release=`grep -o "[0-9]" /etc/redhat-release | head -1`
[root@heartbeat ~]# 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
[root@heartbeat ~]# yum -y install heartbeat #<===centos6.x下yum默认安装heartbeat版本是3.0.4,centos7.x下只能编译安装
[root@heartbeat ~]# cd /usr/share/doc/heartbeat-3.0.4/
[root@heartbeat heartbeat-3.0.4]# cp {ha.cf,haresources,authkeys} /etc/ha.d/
[root@heartbeat heartbeat-3.0.4]# cd /etc/ha.d/
[root@heartbeat ha.d]# chmod 600 /etc/ha.d/authkeys
[root@heartbeat ha.d]# ip addr add 10.0.0.30/24 broadcast 10.0.0.255 dev eth0 #<===添加辅助VIP
[root@heartbeat 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
[root@heartbeat ha.d]# cat authkeys
auth 1
1 sha1 LfW+BX0CQVLls1hrumK9ejVCcfk=
[root@heartbeat ha.d]# cat haresources
#config by root
heartbeat IPaddr::10.0.0.30/24/eth0
#heartbeat2 IPaddr::10.0.0.60/24/eth0
[root@heartbeat ha.d]# ll /etc/init.d/heartbeat
-rwxr-xr-x. 1 root root 10485 Dec 3 2013 /etc/init.d/heartbeat
[root@heartbeat ~]# /etc/init.d/heartbeat start
Starting High-Availability services: INFO: Resource is stopped
Done.
[root@heartbeat ~]# 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
[root@heartbeat ha.d]# chkconfig --add heartbeat
[root@heartbeat 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
centos6.x下yum安装heartbeat的更多相关文章
- CentOS6.5下 yum安装LAMP
CentOS下yum安装LAMP 1. 用yum安装Apache,Mysql,PHP. 1.1安装Apache yum install httpd httpd-devel 安装完成后,用/etc/ ...
- centos6.5下yum安装lnmp(适合刚入职的新手的方法)
新入职的员工,开始的时候都是让配环境,本地写代码用的wamp,在lnmp或lamp测试,除非有些土豪公司 用的是(果机). 另外安装时,把整个流程在脑子里先过一篇(记不全也没关系,一回生二回熟),重在 ...
- centos6.3下yum安装redis
我得是centos 6.3,如果直接用yum安装redis,报错,如下: [root@CentOS6 etc]# yum install redis Loaded plugins: fastestmi ...
- CentOS6.x下yum安装MySQL5.5/5.6
1. 安装mysql-5.5的yum源 # rpm -ivh http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-commu ...
- centos6.5下yum安装mysql5.5
第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了mysql5.1,那就开始卸载咯 2 接下来就是卸载mysql5.1了,命令:rpm -e ...
- Centos6.8下yum安装python2.7
下载 ius-release.rpm包 wget https://centos6.iuscommunity.org/ius-release.rpm 安装ius-release.rpm包 rpm -Uv ...
- CentOS6.10下yum安装MySQL5.7
MySQL官网的Yum仓库快速指南:https://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/ 检查是否安装有MySQL数据库 rpm -qa | ...
- centos6下yum安装mariadb数据库的解决方法
在centos6下Yum安装mariadb数据库时老是提示无法正常安装,看错误日志才发现,是没有mariadb release源文件在/etc/yum.repos.d/中,为此,我特意在新建文件: # ...
- centos6.7下编译安装lnmp
很多步骤不说明了,请参照本人的centos6.7下编译安装lamp,这次的架构是nginx+php-fpm一台服务器,mysql一台服务器 (1)首先编译安装nginx: 操作命令: yum -y g ...
随机推荐
- Miller-Rabin素数测试算法
\(Miller-Rabin\)素数测试 用途 判断整数\(n\)是否是质数,在\(n\)较小的情况下,可以使用试除法,时间复杂度为\(O(\sqrt n)\).但当\(n\)的值较大的时候,朴素的 ...
- 9.Super详解
super注意点: surper()是调用父类的构造方法,而且必须在构造方法的第一个 super必须只能出现在子类的方法或者构造方法中! super()和this()不能同时调用构造方法! Vs th ...
- 开发者必须要了解的架构技术趋势:Service Mesh
内容概要 Service Mesh 是干啥的?解决了什么问题? Service Mesh 的特性 Service Mesh 的主流实现有哪些? 1. Service Mesh 是什么? 简单来讲,Se ...
- Java对接微信公众号模板消息推送
内容有点多,请耐心! 最近公司的有这个业务需求,又很凑巧让我来完成: 首先想要对接,先要一个公众号,再就是开发文档了:https://developers.weixin.qq.com/doc/offi ...
- 高通量计算框架HTCondor(五)——分布计算
目录 1. 正文 1.1. 任务描述文件 1.2. 提交任务 1.3. 返回结果 2. 相关 1. 正文 1.1. 任务描述文件 前文提到过,HTCondor是通过condor_submit命令将提交 ...
- java重点知识点整理
隔壁班的帅哥给我的 1.1简述JAVA的语言特点 a语法简单,功能强大 b分布式与安全性 c与平台无关 d多线程 1.2什么是Java虚拟机?它包括哪几个部分? 解: Java 虚拟机 (JVM ) ...
- SpringBoot中对SpringMVC的自动配置
https://docs.spring.io/spring-boot/docs/1.5.10.RELEASE/reference/htmlsingle/#boot-features-developin ...
- [集训]dance
题意 http://uoj.ac/problem/77 思考 显然能转化为最小割模型.若没有pi的代价,则对于第i个格子,可以让源点连向第i个点,容量为黑色收益,再连向汇点,容量为白色收益.再考虑pi ...
- 对于传统scnece-classfication的分析
BoW模型最初应用于文本处理领域,用来对文档进行分类和识别.BoW 模型因为其简单有效的优点而得到了广泛的应用.其基本原理可以用以下例子来给予描述.给定两句简单的文档: 文档 1:“我喜欢跳舞,小明也 ...
- MVC ajaxfileupload 实现无刷新导入或上传功能
直接上代码吧 前台 先引用 ajaxfileupload.js <script src="~/Scripts/ajaxfileupload.js"></scrip ...