免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1881 | 回复: 0
打印 上一主题 下一主题

[学习分享] HA集群的搭建与vip [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-09-15 08:10 |只看该作者 |倒序浏览
eth0: 业务网络
eth1: 存储网络1
eth2: 存储网络2
eth3: 心跳网络


红帽6 集群工具: luci

红帽7 集群工具: pcs


nodea:
yum -y install pcs
systemctl stop firewalld
systemctl disable firewalld
systemctl start pcsd
systemctl enable pcsd
(安装pcs以后会有一个hacluster)
echo redhat | passwd --stdin hacluster

以下在任意节点输入都一样
pcs cluster auth nodea.cluster0.example.com nodeb.cluster0.example.com nodec.cluster0.example.com
Username: hacluster
Password: redhat    需要输入的部分

pcs cluster status  查看当前集群状态
crm_mon -1  查看当前集群状态
pcs cluster stop nodea.cluster0.exampele.com  停止nodea节点
pcs cluster start nodea.cluster0.example.com  启动nodea节点
pcs cluster stop all  停止所有节点
pcs cluster enable --all  开启节点永久生效
pcs cluster disable --all  关闭节点永久生效


现在创建一个vip(虚拟ip):
选择RESOURCE选项卡, 点击ADD 添加资源

Resource ID: vip
ip: 172.25.0.100

ip addr  查看当前所有ip的详细信息(包括子ip)

pcs cluster standby nodea.cluster0.example.com  模拟nodea坏了
pcs cluster unstandby nodea.cluster0.example.com  模拟nodea好了
pcs resource move vip nodea.cluster0.example.com  将vip移动到nodea节点

corosync-quorumtool -l  显示所有节点信息(包括票数Votes)

quorum=N(机器总数(若是奇数, 则quorum=N/2+1)(quorum是存活要素)

如何推翻quorum的限制:
vim /etc/corosync/corosync.conf  票数总数的配置文件
    quorum_votes: 3    修改某个节点的 票数
    :wq

pcs cluster stop --all
pcs cluster sync  集群间的同步
pcs cluster start --all
(在企业中间, 不建议更改票数)





nodeb:
yum -y install pcs
systemctl stop firewalld
systemctl disable firewalld
systemctl start pcsd
systemctl enable pcsd
(安装pcs以后会有一个hacluster)
echo redhat | passwd --stdin hacluster



nodec:
yum -y install pcs
systemctl stop firewalld
systemctl disable firewalld
systemctl start pcsd
systemctl enable pcsd
(安装pcs以后会有一个hacluster)
echo redhat | passwd --stdin hacluster



foundation:
firefox https加上nodea的主机名端口2224(由于链接会被和谐所以这样打)
Username: hacluster
Password: redhat

create new
Cluster Name: cluster1
Node1: nodea.cluster0.example.com
Node2: nodeb.cluster0.example.com
Node3: nodec.cluster0.example.com
...

(没有使用fence的时候, 将cluster propetries选项中的stonith enabled勾去掉)


No Quorum Policy: 集群存活的要素

新手第一次发帖 请多多谅解

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP