heartbeat部署指南

两台机器的环境:

data-1-1   eth0 10.0.0.7    eth1 172.16.1.7   eth2 10.0.10.7

data-1-2   eth0 10.0.0.8    eth1 172.16.1.8   eth2 10.0.10.8

[[email protected] ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

10.0.10.7    data-1-1

10.0.10.8    data-1-2

[[email protected] ~]# route add -host 10.0.10.8 dev eth2   互相添加路由

[[email protected] ~]# route add -host 10.0.10.7 dev eth2   互相添加路由

更新yum源:

[[email protected] ~]# mkdir /home/oldboy/tools -p

[[email protected] ~]# cd /home/oldboy/tools

[[email protected] tools]# wget http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

[[email protected] tools]# rpm -ivh epel-release-6-8.noarch.rpm

[[email protected] yum.repos.d]# rpm -qa|grep epel        检查是否已安装上

epel-release-6-8.noarch

[[email protected] yum.repos.d]# sed -i ‘s#keepcache=0#keepcache=1#g‘ /etc/yum.conf  是否留下软件包

[[email protected] yum.repos.d]# yum install heartbeat* -y     都需要安装heartbeat软件及其依赖

启动脚本:/etc/init.d/heartbeat

配置文件目录:/etc/ha.d

资源控制目录:/etc/ha.d/resource.d

核心的配置文件:authkey   haresource   ha.cf

配置文件模版放置目录:/usr/share/doc/heartbaeat-3.0.4

ha.cf配置文件:

[[email protected] ha.d]# cat /etc/ha.d/ha.cf

debugfile /var/log/ha-debug

logfile /var/log/ha-log

logfacility     local0

keepalive 2

deadtime 30

warntime 10

initdead 60

udpport 694

mcast eth0 225.0.0.1 694 1 0

auto_failback on

node    data-1-1

node    data-1-2

crm  no

authkeys配置文件

[[email protected] html]# echo chenjisong|sha1sum

8e901fca8d58aa2e2b315b4af1769ffe54e5257a  -

[[email protected] ha.d]# cat authkeys

auth 1

1 sha1 8e901fca8d58aa2e2b315b4af1769ffe54e5257a

[[email protected] ha.d]# chmod 600 authkeys

haresources 配置文件

[[email protected] ha.d]# cat haresources

data-1-1   IPaddr::10.0.0.17/24/eth0        ====虚拟IP

data-1-2   IPaddr::10.0.0.18/24/eth0        ====虚拟IP

[[email protected] ha.d]# /etc/ha.d/resource.d/IPaddr 10.0.0.17/24/eth0 start

[[email protected] ha.d]# ip a|grep 10.0.0.17

inet 10.0.0.17/24 brd 10.0.0.255 scope global secondary eth0

[[email protected] ha.d]# /etc/ha.d/resource.d/IPaddr 10.0.0.18/24/eth0 start

[[email protected] ha.d]# ip a|grep 10.0.0.18

inet 10.0.0.18/24 brd 10.0.0.255 scope global secondary eth0

两台机器上面安装httpd

然后启停heartbeat服务,查看ip漂移过程

heartbeat的使用场景:

时间: 2024-08-24 23:37:13

heartbeat部署指南的相关文章

Spark1.0.0部署指南

1 节点说明   IP Role 192.168.1.111 ActiveNameNode 192.168.1.112 StandbyNameNode,Master,Worker 192.168.1.113 DataNode,Master,Worker 192.168.1.114 DataNode,Worker HDFS集群和Spark集群之间节点共用. 2 安装HDFS 见HDFS2.X和Hive的安装部署文档:http://www.cnblogs.com/Scott007/p/3614960

Openstack Mitaka for Centos7.2 部署指南(一)

本文主要参考 https://www.zybuluo.com/ncepuwanghui/note/389373 OpenStack Mitaka for Ubuntu 16.04 LTS 部署指南 http://docs.openstack.org/mitaka/install-guide-rdo/ 官方文档 把上面的Ubuntu 换成Centos,其他详情请看上面的部署指南 本文主要参考 https://www.zybuluo.com/ncepuwanghui/note/389373 Open

微软ASPNET站点部署指南(10):迁移至SQLServer(转载)

微软ASPNET站点部署指南(10):迁移至SQLServer 1.  综述 第2章的部署SQL Server Compact和第9章的部署数据库更新里解释了为什么最终要升级到完整版SQL Server .本章节将告诉你如何来做. SQL Server Express和完整版SQL Server 一旦你决定使用完整版SQL Server,你需要在开发和测试环境使用SQL Server Express 或者完整版SQL Server.在工具支持和数据库引擎功能上,SQL Server Compac

nmon性能监控工具介绍与部署指南

1.nmon简要介绍 nmon是IBM开发,对操作系统层的性能监控工具,有aix和linux两种版本 2.nmon下载地址 2.1.nmon for aix下载地址 https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power%20Systems/page/nmon 2.2 .nmonfor linux下载地址 http://nmon.sourceforge.net/pmwiki.php?n=Site.D

Redmine与Zentao同机快速部署指南

Redmine与Zentao 同机快速部署指南 1.环境 系统:CentOS 7 x64 软件:Redmine 3.0.Zentao 7.2 Source Redmine 3.0 是先安装的,目录 /opt/redmine,访问地址 http://127.0.0.1/redmine Zentao 7.2 是后安装的,目标访问地址 http://127.0.0.1/zentao 2.已知 Redmine与zentao 都依赖 apache mysql, apache 监听端口为 80 8080 s

cobbler自动化部署指南

文章结构 1. 前言 2. cobbler安装 3. 系统定制 4. 参考链接 前言: 给电脑装过系统的同学都知道,不论是从U盘.光驱或者其他设备装系统,都需要先在BIOS里设置开机启动项(或用开机快捷键设置).从上大学到现在,我帮同学装系统少说也有上百次,但是还从来没有使用从网卡启动安装过,虽然以前也注意到,但一直不知道那是个什么玩意,见图(1).前段时间在实习公司做Openstack的自动化安装与部署工作,才有幸接触到,原来这是一种从网卡远程启动的技术! 图1 BIOS启动项界面 要从网卡启

Centos7操作系统部署指南

一.硬件环境: Dell R620 二.软件环境: Centos6.4 X86_64 +KVM Windows7+vnc 三.安装说明 操作系统更新之迅速,让作为新手的系统运维人员有点措手不及,相对于老手就胸有成竹.怎么讲?因为老手对技术方向把握的很好,哪些技术需要深入研究,哪些需要基本了解即可,优先级早已安排妥当. 接下来要讲的"Centos7操作系统的部署"同样基于此思想,我们只需了解大致的安装过程,有哪些新功能.至于在centos7环境下各种软件的安装,我们可以等到用之前,紧急突

[转]Nginx反向代理和负载均衡部署指南

Nginx反向代理和负载均衡部署指南 1.        安装 1)         从Nginx官网下载页面(http://nginx.org/en/download.html)下载Nginx最新版本(目前是1.5.13版本)安装包: 2)         解压后复制到部署目录. 2.        启动和停止Nginx Nginx目前只支持命令行操作,操作前先进入Dos命令环境,并进入Nginx部署目录. 1)         启动Nginx:start nginx 2)         停

Project Server 2003配置部署指南_百度文库

Project Server 2003配置部署指南_百度文库 Project server 2003配置部署指南 - 网管地带 - IT博客