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 ...
随机推荐
- Elasticsearch系列---搜索执行过程及scroll游标查询
概要 本篇主要介绍一下分布式环境中搜索的两阶段执行过程. 两阶段搜索过程 回顾我们之前的CRUD操作,因为只对单个文档进行处理,文档的唯一性很容易确定,并且很容易知道是此文档在哪个node,哪个sha ...
- NTT 求原根
使用NTT需要保证模数mod 为质数. 通过以下代码求得一个模数的原根 , 常见的质数的原根 998244353 -> 3 1e9+7 -> 5 #include<bits/ ...
- dp-LCS(递归输出最短合串)
Problem Description The company "21st Century Fruits" has specialized in creating new sort ...
- NPOI导出Excel生成多个sheet
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- 【python系统学习05】input函数——实现人机交互
input函数 目录 input用途 语法 示例 参数 返回值 返回值数据类型转换 容错处理 动手吧 input用途 实现人机交互: 1.你提出问题打印在屏幕上, 2.运行程序的人再输入回答. 3.按 ...
- .net Core Autofac稍微高级一点的方法
前情摘要 前段时间写了autofac的注入但是每次都需要去修改startup这应该不是大家想要的. 至少不是我想要的. 网上有朋友说可以创建一个基础类来时间. 好了吹牛时间结束我们开始干点正事. 创建 ...
- [bzoj4567] [loj#2012] [SCOI2016] 背单词
Description \(Lweb\) 面对如山的英语单词,陷入了深深的沉思,「我怎么样才能快点学完,然后去玩三国杀呢?」.这时候睿智的凤老师从远处飘来,他送给了 \(Lweb\) 一本计划册和一大 ...
- Sublime Text 3 安装包
摘要 Error while loading PyV8 binary:exit code 3 .sublime-package报错 安装SublimeREPL,可以运行python代码 安装local ...
- 每天翻译一点点: WPF Application Framework (WAF)
ps:http://waf.codeplex.com/wikipage?title=Model-View-ViewModel%20Pattern&referringTitle=Document ...
- Collections.synchronizedList 、CopyOnWriteArrayList、Vector介绍、源码浅析与性能对比
## ArrayList线程安全问题 众所周知,`ArrayList`不是线程安全的,在并发场景使用`ArrayList`可能会导致add内容为null,迭代时并发修改list内容抛`Concurre ...