Centos5.5 YUM安装heartbeat
2014-04-19 22:03
447 查看
1. 2台主机,分别用一台node1,一台node2
如果你不知道请用下面命令
参考动手搭建centos下用heartbeat实现双机热备heartbeat V2在CentOS4.6上简要安装、配置笔记
如果你不知道请用下面命令
uname -n2. 网卡分配 vim /etc/hosts
127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.0.151 node1 192.168.0.152 node2 10.0.0.111 vip1 10.0.0.112 vip23.安装软件
yum -y install httpd yum -y install ipvsad yum -y install heartbeat其中http做测试使用4.关掉多余的服务(当然你也可以不关闭,我是在虚拟机做的)
/sbin/chkconfig acpid off /sbin/chkconfig anacron off /sbin/chkconfig apmd off /sbin/chkconfig auditd off /sbin/chkconfig autofs off /sbin/chkconfig bluetooth off /sbin/chkconfig cpuspeed off /sbin/chkconfig cups off /sbin/chkconfig gpm off /sbin/chkconfig haldaemon off /sbin/chkconfig iptables off /sbin/chkconfig isdn off /sbin/chkconfig kudzu off /sbin/chkconfig mDNSResponder off /sbin/chkconfig mdmonitor off /sbin/chkconfig messagebus off /sbin/chkconfig netfs off /sbin/chkconfig nfslock off /sbin/chkconfig nifd off /sbin/chkconfig pcmcia off /sbin/chkconfig portmap off /sbin/chkconfig rhnsd off /sbin/chkconfig rpcgssd off /sbin/chkconfig rpcidmapd off /sbin/chkconfig sendmail off /sbin/chkconfig xfs off5. copy文件
cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/ cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/ cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/6.修改配置
vim /etc/ha.d/ha.cf
logfile /var/log/ha-log # 日志文件 logfacility local0 # 登陆/调试日子同时记录给syslog keepalive 2 # 设定heartbeat之间的检测时间间隔 deadtime 30 # 在30秒后宣布接点死亡,主服务器、从服务器切换 warntime 10 # 日志中发出"last hearbeat"警告之前等待的时间,单位秒 initdead 120 # 一些配置下,重启网络需要一些时间才能正常工作,就是这里设置,一般设置为deadtime的两倍 udpport 694 # 使用端口694进行bcast和ucast通信,这是默认的 bcast eth1 # 表示在eth1接口上使用来发送心跳信息 ucast eth1 10.0.0.111 # 采用网卡eth1的udp单薄来通知心跳,ip为对方ip #baud 19200 # 波特率,串口通信的速度 node node1 # 必须配置的,急群众机器的主机名,与"uname -n"输出相同 node node2 # 同上 ping 192.168.0.1 # 用来验证外网线联通的ip,推荐为上级路由器
vi /etc/ha.d/authkeys这里要修改它的权限chmod 600 /etc/ha.d/authkeys 否则无法启动
auth 1 # 认证算法选择,只要前后对应即可 1 crc #2 sha1 HI! #3 md5 Hello!
vi /etc/ha.d/haresources
node1 10.0.0.222 httpd7. 配置备机、备机做相同的操作8.
启动服务
service heartbeat start9.测试、主备机分别新建html文件
vim /var
/www/html/index.html
test node1 主机
test node2 备机LINUX下火狐主备机 http://10.0.0.222
参考动手搭建centos下用heartbeat实现双机热备heartbeat V2在CentOS4.6上简要安装、配置笔记
相关文章推荐
- Centos下Yum安装PHP5.5,5.6,7.0
- 通过yum在CentOS5.5上安装MySQL5.1
- CentOS5.5使用yum来安装LAMP
- Centos下Yum安装PHP 5.5、5.6、7.0
- (二)Centos7下Yum更新安装PHP5.5,5.6,7.0
- CentOS-5 yum安装mysql-5.5/5.1
- Centos下Yum安装PHP5.5,5.6,7.0及扩展
- Centos下Yum安装PHP5.5,5.6,7.0
- CentOS 6.5通过yum安装 MySQL-5.5
- Centos下Yum安装PHP5.5,5.6,7.0
- 通过yum在CentOS5.5上安装MySQL5.1
- CentOS 5.5如何通过yum安装Zend Optimizer
- centos7.0 yum 安装php服务器(apache2.4 php 5.4/5.5/5.6/7.0)
- CentOS5.5使用yum来安装LAMP
- Centos7下Yum安装PHP5.5,5.6,7.0
- Centos下Yum安装PHP5.5,5.6,7.0
- centos5.5 yum 安装nginx
- Centos6.4 yum安装MariaDB5.5
- CentOS 5.5 使用 EPEL 和 RPMForge 软件库,以及 yum 安装 LNMP
- centos6.5 yum安装php5.5,mysql5.5.46 ,aphche 2.2.15