Skip to content

Instantly share code, notes, and snippets.

@larsks
Forked from feist/gist:2697640
Last active December 13, 2015 22:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save larsks/4983187 to your computer and use it in GitHub Desktop.

Run the following commands on all three nodes in the cluster (nodes are named f1, f2 and f3). This will create the corosync.conf files for the cluster.

[root@f1 pcs]# ./pcs cluster configure my_cluster_name f1 f2 f3
[root@f2 pcs]# ./pcs cluster configure my_cluster_name f1 f2 f3
[root@f3 pcs]# ./pcs cluster configure my_cluster_name f1 f2 f3

Then run the following command on all three nodes in the cluster, to start corosync and pacemaker.

[root@f1 pcs]# ./pcs cluster start
Starting Cluster
[root@f2 pcs]# ./pcs cluster start
Starting Cluster
[root@f3 pcs]# ./pcs cluster start
Starting Cluster

You can get cluster status...

[root@f1 pcs]# ./pcs status        
Cluster Status:
 Last updated: Mon May 14 16:49:29 2012
 Last change: Mon May 14 16:39:16 2012 via crmd on f1
 Stack: corosync
 Current DC: f2 (2) - partition with quorum
 Version: 1.1.7-2.fc17-ee0730e13d124c3d58f00016c3376a1de5323cff
 3 Nodes configured, unknown expected votes
 0 Resources configured.

Resources:

Nodes:
 Online: f3 f1 f2 

Disable stonith...

[root@f1 pcs]# ./pcs property set stonith-enabled=false

Create a resource...

[root@f1 pcs]# ./pcs resource create ClusterIP IPaddr2 ip=192.168.122.99 cidr_netmask=32 op monitor interval=30s
[root@f1 pcs]# ./pcs resource list
 ClusterIP	(ocf::heartbeat:IPaddr2) Started 
[root@f1 pcs]# ping 192.168.122.99
PING 192.168.122.99 (192.168.122.99) 56(84) bytes of data.
64 bytes from 192.168.122.99: icmp_req=1 ttl=64 time=0.017 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment