Corosync
Corosync is an open supply Cluster Engine. it’s miles virtually a communication gadget that enables or extra Linux Cluster nodes to transfer statistics among them. Corosync is continually listening on designed port number wherein Linux Cluster nodes are sending information. Corosync verbal exchange machine permits all of the nodes to recognise the precise state of each other in any respect time. In case one of system nodes gets fail in Linux Cluster this records may be at once transferred to different still exsisting Linux Cluster nodes.
Pacemaker
Pacemaker is an open source high availability resource manager. because the name says, Pacemaker manages assets. Pacemaker empowers detection and recovery of utility and gadget screw ups. Pacemaker keeps the configuration of all assets Linux Cluster will manage as additionally all family members between the Machines and assets. In case one of system nodes gets fail in Linux Cluster Pacemaker will detect this and begin configured resources on one of the othe available Linux Cluster nodes.
In this guide i am going to setup high availability linux cluster with Pacemaker and Corosync.
Setup DNS record for cluster nodes as well as NTP time synchronization.
172.22.0.60 – node1.linuxpcfix.com
172.22.0.61 – node2.linuxpcfix.com
Setup and enable HA-Clustering repo from opensuse to install require packages on the serverm, So create a repo file and append the following lines.
[haclustering]
name=HA Clustering
baseurl=http://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-6/
enabled=1
gpgcheck=0
Then run the following command to install packmaker, crm shell and corosync on both available nodes.
Now generate the corosync authkey by using corosync-keygen command.
after complete the corosync-keygen process you can find the new authkey in /etc/corosync/ directory with named authkey.
Copy the newly generated authkeys to secondary cluster node.
Change the directory /etc/corosync/ to create corosync configuration file.
[root@linuxpcfix~]# vim corosync.conf
And append the following lines in corosync.conf file.
totem {
version: 2
secauth: off
interface {
member {
memberaddr:172.22.0.60
}
member {
memberaddr:172.22.0.61
}
ringnumber: 0
bindnetaddr: 172.22.0.60
mcastport: 5405
ttl: 1
}
transport: udpu
}
logging {
fileline: off
to_logfile: yes
to_syslog: yes
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
# this will start Pacemaker processes
service {
ver: 0
name: pacemaker
}
copy the corosync.conf file on secondary node also.
Note: Change the ip address of node2.linuxpcfix.com
Then start the corosync and packemaker on both servers node
[root@linuxpcfix~]# service pacemaker start
Now check the cluster status
[root@linuxpcfix~]# crm status
[root@linuxpcfix~]# crm configure show
Note:- You can copy sample unicast configuration file as given below.
[root@linuxpcfix~]# cp /etc/corosync/corosync.conf.example.udpu /etc/corosync/corosync.conf
One thought on “High Availability linux cluster with Pacemaker and Corosync”-
Pingback: How to Setup Mariadb Cluster on Centos - The LinuxPcFix