corosync+pacemaker+crm+nfs
实验环境
node1:ip:172.16.11.5 centos6.5+httpd+corosync+pacemaker+crm
node2:ip:172.16.11.6 centos6.5+httpd+corosync+pacemaker+crm
node3:ip:172.16.11.7 nfs
1、时间同步
时间同步机制
ssh node2.www.org.com "date -s '20140914 23:12:30'";date -s '20140914 23:12:30'
2、基于密钥认证
3、修改hosts
ping测试
ssh node1.www.org.com 'date';date
4、vim /etc/sysconfig/network
使主机名与root@xxxxx#一致
5、软件安装
yum install pacemaker -y
yum install pssh-2.3.1-2.el6.x86_64.rpm crmsh-1.2.6-4.el6.x86_64.rpm
server corosync restart
注意这里第一次安装的会有熵池的东西,需要你敲键盘,不要意外。
6、提供配置文件
cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf
vim /etc/corosync/corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank
totem {
version: 2
secauth: on
threads: 0
interface {
ringnumber: 0
bindnetaddr: 172.16.0.0 #重点就是这个是网段地址,不同网段配置不同网络地址
mcastaddr: 226.194.21.156 #组播地址保持
mcastport: 5405
ttl: 1
}
}
logging {
fileline: off
to_stderr: no
to_logfile: yes
to_syslog: no
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
amf {
mode: disabled
}
service {
ver: 0
name: pacemaker #重要信息
}
aisexec { #以啥身份认证
user: root
group: root
}
scp /etc/corosync/corosync.cnf 172.16.11.6:/etc/corosync/
7、crm的配置使服务能够提供httpd的高可用
crm configure
stonith-enabled=false
no-quorum-policy=ignore
primitive webip ocf:IPaddr params ip=172.16.11.148 op monitor timeout=20s interval=60s
primitive webserver lsb:httpd op monitor timeout=20s interval=30s
primitive webserver lsb:httpd op monitor timeout=20s interval=30s
group webservice webip webserver
8、命令的基本练习
clearstate node2
primitive webip ocf:IPaddr params ip=172.16.11.148 op monitor timeout=20s interval=60s
resource
cleanup webserver
delect webserver
delect webserver_with_webip
colocation webip_with_webserver inf: webip webserver
order webip_before_webserver mandatory: webip webserver
location webip_on_node2 webip inf: node2.www.org.com
location webip_on_node2 webip rule inf: #uname eq node2.www.org.com
location webserver_on_node2 webserver rule -inf: #uname eq node2.www.org.com
colocation 排序 资源在一起 建议用group来定义
order 顺序 先启动那个,先关闭那个
location 位置 节点挂了,重新上线,更加倾向于那个节点,主要用在服务器性能不一致的场景中,
如果资源本身出问题啦,我们必须修改监控时间,不然主页是不能访问,,它不会自动起来,节点资源httpd本身挂啦,HA节点都在好着,不定义时间监控服务室起不来的
9、资源
资源:主资源,组资源,克隆资源,主从资源
10、节点3提供nfs
vim/etc/exports
/www/html 172.16.1.0/16(no_root_squash,root)
service nfs restart
11、各节点测试挂载
showmount -e 节点3的ip
mount -t nfs 172.16.11.7:/www/html /post
umount
12、扩展nfs共享安装网页
crm configuer
primitive webstore ocf:Filesystem params device="172.16.11.7:/www/html" directory="/var/www/html" fstype="nfs" op monitor interval=60 timeout=30
group webservice webip webstore webserver
order webip_before_webstore_before_webservice inf: webip webstore webservice
show xml 查看先后顺序
网页测试
crm node online #强制资源上线
crm node standby #强制资源下线
13、全部配置
node node1.www.org.com \
attributes standby="off"
node node2.www.org.com
primitive webip ocf:heartbeat:IPaddr \
params ip="192.168.1.10" \
op monitor timeout="20s" interval="60s"
primitive webserver lsb:httpd \
op monitor timeout="20s" interval="30s"
primitive webstore ocf:heartbeat:Filesystem \
params device="192.168.1.7:/www/html" directory="/var/www/html" fstype="nfs" \
op monitor interval="60s" timeout="40s" \
op start timeout="60s" interval="0" \
op stop timeout="60s" interval="0"
group webservice webip webstore webserver
order webip_before_webstore_before_webservice inf: webip webstore webservice
property $id="cib-bootstrap-options" \
dc-version="1.1.10-14.el6-368c726" \
cluster-infrastructure="classic openais (with plugin)" \
expected-quorum-votes="2" \
stonith-enabled="false" \
no-quorum-policy="ignore"
转载于:https://blog.51cto.com/1983939925/1557312
corosync+pacemaker+crm+nfs相关推荐
- corosync+pacemaker+crm简单配置
# 系统 centos7.2 安装版本都是Yum源 node1: 192.168.8.111 node2:192.168.8.112 vip :192.168.8.200 nfs ...
- Corosync与Pacemaker实现nfs作为共享存储的MySQL高可用
1. 安装corosync和pacemaker yum -y install corosync pacemaker 2. 配置pacemaker做为corosync的插件运行: vim /etc/co ...
- Linux高可用集群(Corosync+Pacemaker)
说在前面: 这个编辑器也太霸道了,,两个浏览器,,一个不能粘贴,一个不能上图,只能保存草稿之后切换, 造孽啊! 写博不易,且看且珍惜 [蜡烛] ntp服务器配置 # vim /etc/ntf. ...
- CentOS 6.5环境实现corosync+pacemaker实现DRBD高可用
DRBD (Distributed Replicated Block Device)分布式复制块设备,它是 Linux 平台上的分散式储存系统,通常用于高可用性(high availability, ...
- corosync+pacemaker高可用集群
简介 高可用集群,是指以减少服务中断(如因服务器宕机等引起的服务中断)时间为目的的服务器集群技术.简单的说,集群就是一组计算机,它们作为一个整体向用户提供一组网络资源.这些单个的计算机系统就是集群的节 ...
- corosync+pacemaker实现高可用(HA)集群(二)
部署方案二(推荐):corosync+pacemaker 利用ansible自动安装corosync和pacemaker 注:关于ansible的具体使用可参见"ansible实现自动化自动 ...
- corosync+pacemaker+crmsh的高可用web集群的实现
网络规划: node1:eth0:172.16.31.10/16 node2: eth0: 172.16.31.11/16 nfs: eth0: 172.16.31.12/15 注: nfs在提供 ...
- Corosync Pacemaker 高可用 Mariadb
1.安装前准备 高可用集群一般需要配置时间同步.基于主机名互相通信.ssh的互信通信,Corosync Pacemaker 仅需要配置时间同步.基于主机名互相通信即可: yum install ch ...
- corosync+pacemaker+crmsh配置高可用集群。
实验环境: admin1.tuchao.com 192.168.18.100 ansible管理节点 admin2.tuchao.com 192.168.18.101 集群节点一 admin3.t ...
最新文章
- 中国最大的python社区-python中的最小最大算法
- 201671010436 王雪刚 实验四 《英文文本统计分析》结对项目报告
- python安装pyopenssl
- Gui系统之View体系(2)---View的setContent
- [转载+原创]Emgu CV on C# (五) —— Emgu CV on 局部自适应阈值二值化
- 确保HIPAA符合远程医疗视频流的2种方法
- 常用数据类型(C#)
- C#实现文件下载代码
- linux中将 home目录备份成,6种优化Linux系统备份的应用与技巧
- shell+html+div+css实现数据库冷备文件检查
- bootstrap模态框 遮挡_Bootstrap Modal遮罩弹出层
- SpringMVC处理Json、文件上传、拦截器
- (87)FPGA锁存器与触发器-面试必问(十一)(第18天)
- 优秀程序员必须知道的八件事情
- java架构师之路:JAVA程序员必看的15本书
- 世外桃源六python_中土世界的世外桃源——新西兰霍比特人小镇全攻略
- 万亿估值来了!3次大难不死,蚂蚁金服终于登顶世界第一
- 腾讯、华为角逐“云游戏”
- rockchip eDP 配置
- Windows下HdWiki安装步骤
热门文章
- 原型模式的应用场景_23中设计模式(上)
- mac下用vim编写程序
- java游戏模拟器mx5_OPPO华为VIVO魅族金立电脑手游安卓模拟器官方下载
- windows如何访问linux系统文件,如何从 Windows 访问 Linux 文件?——方法步骤
- linux .net core java_仅在.NET Core 2.0运行时的Linux上缺少运行时存储库错误
- c++中获取蓝图组件_蓝图C++混合编程
- STM32串口在首次发送字符的时候,首字符丢失解决办法
- 【学术相关】如何找到研究的突破点?
- 【机器学习】漫谈特征缩放
- 【算法基础】数据结构导论第七章-排序.pptx