The Corosync Cluster Engine is a Group Communication System with additional features for implementing high availability within applications.
A kind of masterpiece for high availability solutions and redundant systems with special requirement.
This stack is able to accept challenges in datacenter area to provide infrastructure high availability also across multiple different fire protection zones and over miles.
Firewall, load balancer, webservers, VPN-Concepts, doesn’t matter, sound like a swiss knife. Try and simplify your life.
All this was written for openSUSE 15.0 with a default 4.12 kernel.
Install required cluster stack packages, all dependencies will be automatically installed:
1 | zypper in corosync pacemaker |
Enable autostart for pacemaker service:
systemctl enable pacemaker.service |
Example configuration for corosync cames automatically by the installation:
cp /etc/corosync/corosync.conf.example /etc/corosync/corosync.conf |
Configure corosync:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | totem { version: 2 crypto_cipher: none crypto_hash: none clear_node_high_bit: yes interface { ringnumber: 0 bindnetaddr: 172.18.20.91 mcastaddr: 239.255.3.1 mcastport: 5415 ttl: 1 } } logging { fileline: off to_stderr: no logfile: /var/log/cluster/corosync.log to_syslog: yes debug: off timestamp: on logger_subsys { subsys: QUORUM debug: off } } quorum { provider: corosync_votequorum } nodelist { node { ring0_addr: 172.18.20.91 } node { ring0_addr: 172.18.20.92 } } |
bindnetaddr is a static ip address if your node and should be unique on each cluster node!
mcastaddr do not reuse multicast addresses across different corosync clusters! The same applies mcastport option.
A separate log directory was defined in the configuration to split the logs from the default system messages;
So create the directory before starting the corosync.service:
mkdir /var/log/corosync |
Start cluster stack on both nodes:
1 | systemctl start pacemaker.service |
It will take some seconds and they will see each other and join to pair
[TOTEM] A new membership (172.18.20.92:8) was formed. Members joined: 167845468
1 2 3 4 5 6 7 8 9 10 | crm configre show node 167845467: node01 node 167845468: node02 property cib-bootstrap-options: \ default-resource-stickiness=INFINITY \ no-quorum-policy=ignore \ cluster-recheck-interval=3min \ dc-version=1.1.12-1.1.12.git20140904.266d5c2 \ cluster-infrastructure=corosync \ stonith-enabled=false |
Make sure everything you do, reaches all cluster members. This is the main rule to have a stable and synchronous cluster-system of multiple nodes.
If this is your first Cluster experience, take a look into the hawk project, which basically provides a web GUI for your cluster.
Interface can help you to make the first steps and get in touch with the cluster. Attention: don’t use it in production environment.
For more deeper information take a look into this post.
Sources:
– http://clusterlabs.org
– https://github.com/ClusterLabs/hawk
Leave a Reply