Corosync short how-to

The Corosync Cluster Engine is an open source project derived from the OpenAIS project and licensed under the new BSD License. The mission of the Corosync effort is to develop, release, and support a community-defined, open source cluster executive for use by multiple open source and commercial cluster projects or products.
DRBD® software (Distributed Replicated Block Device) is a distributed replicated storage system for the Linux platform. It is implemented as several userspacemanagement applications and some shell scripts and is normally used on high availability (HA) computer clusters.
This is simple example for CentOS 6.3
node01: /etc/init.d/iptables stop
node02: /etc/init.d/iptables stop
node01: chkconfig –level 3 iptables off
node02: chkconfig –level 3 iptables off
node01 and node02 DISABLE SELINUX vi /etc/selinux/config
node01: yum install pacemaker corosync
node02: yum install pacemaker corosync
node01:corosync-keygen
node01: vi /etc/corosync/corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank
totem {
version: 2
secauth: off
interface {
member {
memberaddr: 192.168.0.199
}
member {
memberaddr: 192.168.0.200
}
ringnumber: 0
bindnetaddr: 192.168.0.199
mcastport: 5405
ttl: 1
}
transport: udpu
}
logging {
fileline: off
to_logfile: yes
to_syslog: yes
debug: on
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
node01: vi /etc/corosync/service.d/pcmk
service {
# Load the Pacemaker Cluster Resource Manager
name: pacemaker
ver: 0
}
node02: cat /etc/corosync/corosync.conf
# Please read the corosync.conf.5 manual page
compatibility: whitetank
totem {
version: 2
secauth: off
interface {
member {
memberaddr: 192.168.0.199
}
member {
memberaddr: 192.168.0.200
}
ringnumber: 0
bindnetaddr: 192.168.0.200
mcastport: 5405
ttl: 1
}
transport: udpu
}
logging {
fileline: off
to_logfile: yes
to_syslog: yes
debug: on
logfile: /var/log/cluster/corosync.log
debug: off
timestamp: on
logger_subsys {
subsys: AMF
debug: off
}
}
node02: vi /etc/corosync/service.d/pcmk
service {
# Load the Pacemaker Cluster Resource Manager
name: pacemaker
ver: 0
}
node01:scp /etc/corosync/authkey root@192.168.0.200:/etc/corosync
node01:/etc/init.d/corosync start
node01:chkconfig –level 3 corosync on
node02:/etc/init.d/corosync start
node02:chkconfig –level 3 corosync on
node01:crm_verify -L
node01:crm configure property stonith-enabled=false
node02:crm_verify -L
node02:crm configure property stonith-enabled=false
crm configure primitive ClusterIP ocf:heartbeat:IPaddr params ip=192.168.0.201 cidr_netmask=24 op monitor interval=1s
crm configure edit
crm resource show
crm resource migrate ClusterIP filer02.embeddedsoft.int
ip addr
crm node
standby nodename
online nodename
node filer01.embeddedsoft.int \
attributes standby=”off”
node filer02.embeddedsoft.int \
attributes standby=”off”
primitive drbd_cluster ocf:linbit:drbd \
params drbd_resource=”disk0″
primitive fs_cluster ocf:heartbeat:Filesystem \
params device=”/dev/drbd0″ directory=”/cluster/” fstype=”ext4″
primitive httpd lsb:httpd
primitive ip_cluster ocf:heartbeat:IPaddr2 \
params ip=”192.168.0.201″ nic=”eth0″
primitive mysqld lsb:mysqld
group server_group fs_cluster ip_cluster mysqld httpd
ms ms_drbd_cluster drbd_cluster \
meta master-max=”1″ master-node-max=”1″ clone-max=”2″ clone-node-max=”1″ notify=”true”
colocation cluster_on_drbd inf: server_group ms_drbd_cluster:Master
order cluster_after_drbd inf: ms_drbd_cluster:promote server_group:start
property $id=”cib-bootstrap-options” \
dc-version=”1.1.7-6.el6-148fccfd5985c5590cc601123c6c16e966b85d14″ \
cluster-infrastructure=”openais” \
expected-quorum-votes=”2″ \
stonith-enabled=”false” \
no-quorum-policy=”ignore”
Add your comment

Your email address will not be published. Required fields are marked *