ln -s '/usr/lib/systemd/system/pcsd.service' '/etc/systemd/system/multi-
user.target.wants/pcsd.service'
$ echo hacluster | passwd hacluster --stdin
changing password for user hacluster.
changing password for user hacluster.
passwd: all authentication tokens updated successfully.
4.
集群认证
在任何一个节点上执行,这里选择
node1
:
$ pcs cluster auth
-u
hacluster
-p
hacluster
10.16.93.179
10.16.93.182
10.16.93.179
: authorized
10.16.93.182
: authorized
5.
同步配置
在
node1
上执行:
$ pcs cluster setup
--
last_man_standing
=1
--
name pgcluster
10.16.93.179
10.16.93.182
shutting down pacemaker/corosync services
...
redirecting
to
/bin/systemctl stop pacemaker
.
service
redirecting
to
/bin/systemctl stop corosync
.
service
killing any remaining services
...
removing
all
cluster configuration files
...
10.16.93.179
: succeeded
10.16.93.182
: succeeded
6.
启动集群
在
node1
上执行。(有时需要稍等十几秒,才能看到命令的输出结果):
$ pcs cluster start
--all
172.17.5.90
: starting cluster
...
172.17.5.91
: starting cluster
...
172.17.5.92
: starting cluster
...
7.
检验
1
)检验
corosync
在
node1
上执行:
$ pcs status corosync
membership information
----------------------
nodeid votes name
1 1 10.16.93.179 (local)
2 1 10.16.93.182
2
)检验
pacemaker
root@10 data]# pcs status
cluster name: pgcluster
warning: corosync and pacemaker node names
donotmatch (ips used in setup?)
文档被以下合辑收录
评论