- 论坛徽章:
- 0
|
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: 集群存活的要素
新手第一次发帖 请多多谅解
|
|