CentOS环境下进行集群管理可参考以下步骤:
yum install pacemaker corosync pcs
一键安装。pcs cluster auth <节点名>
命令配置节点间认证。pcs cluster setup --name <集群名> <节点1> <节点2>
创建集群。pcs cluster start --all
启动所有节点的集群服务。pcs resource create
命令添加资源,如虚拟IP、HTTP服务等。例如:pcs resource create vip ocf:heartbeat:IPaddr2 ip=192.168.1.100 cidr_netmask=24
。pcs status
查看资源状态,pcs resource show
查看资源详情。pcs property set stonith-enabled=false
关闭stonith(可选)。journalctl -u pcsd
查看集群日志,排查故障。参考资料:[1,2,3,4,5,6,8,9,10,11]