[ClusterLabs] Start at boot time Corosync 2.X + Pacemaker 1.1 cluster (Debian Wheezy)

d.malcangio at eletech.it d.malcangio at eletech.it
Fri Jun 5 13:30:15 EDT 2015

Hello everyone,
I am having what seems an easy problem to solve, but I don't know the
correct way to solve it.
I've been googling for a solution for almost a week without luck.
(All I found was this but had no clear and clean solution

I have created a two node cluster NOT FOR PRODUCTION with the following
configuration on both nodes:
-Debian Wheezy 7.7
-Corosync v2.3.4
-Pacemaker v1.1.12
-Libqb v0.17.1
-Cluster-glue v1.0.12
-Resource-agents v3.9.6
-crmsh v2.1.0

I've installed the cluster software from source following this guide
http://clusterlabs.org/wiki/Compiling_on_Debian (for Jessie)
Before installing I made sure there were no older corosync or pacemaker

After the installation I configured my cluster editing the file (on both
nodes) corosync.conf and creating and copying the authkey

    # Please read the corosync.conf.5 manual page
    totem {
            version: 2
    #       crypto_cipher: none
    #       crypto_hash: none
            secauth: off
            cluster_name: my-cluster
    #       interface {
    #               ringnumber: 0
    #               bindnetaddr:
    #               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: QUORUM
                    debug: off
    nodelist {
            node {
                    name: pc1
                    nodeid: 1
            node {
                    name: pc2
                    nodeid: 2
    quorum {
            # Enable and configure quorum subsystem (default: off)
            # see also corosync.conf.5 and votequorum.5
            provider: corosync_votequorum
            two_node: 1

I've configured the resources on pacemaker 

    node 1: pc-1
    node 2: pc-2
    primitive cluster-apache2 apache \
    	params configfile="/etc/apache2/apache2.conf"
httpd="/usr/sbin/apache2" port=80 \
    	op monitor interval=10s timeout=60s \
    	op start timeout=40s interval=0 \
    	op stop timeout=60s interval=0
    primitive cluster-ip IPaddr2 \
    	params ip= cidr_netmask=24 \
    	op monitor interval=10s timeout=20s \
    	op start timeout=20s interval=0 \
    	op stop timeout=20s interval=0
    primitive cluster-tftp lsb:tftpd-hpa \
    	op monitor interval=30 \
    	op start interval=0 timeout=120s \
    	op stop interval=0 timeout=120s
    colocation my-cluster-dependency inf: cluster-ip cluster-apache2
    property cib-bootstrap-options: \
    	dc-version=1.1.12-561c4cf \
    	cluster-infrastructure=corosync \
    	stonith-enabled=false \

After all the configuratins I've started both corosync and pacemaker with

/etc/init.d/corosync start

The cluster is up and running, but I can't find a way to start the cluster
at boot time

root at PC:~# crm_mon -1
Last updated: Fri Jun  5 16:33:49 2015
Last change: Thu Jun  4 18:35:38 2015
Stack: corosync
Current DC: pc1 (1) - partition WITHOUT quorum
Version: 1.1.12-561c4cf
2 Nodes configured
2 Resources configured

Online: [ pc1 pc2 ]

I've tried adding the init.d scripts to runlevels, but I get no response
and no effect on corosync

root at PC:~# update-rc.d corosync defaults 
update-rc.d: using dependency based boot sequencing

and this error on pacemaker

root at PC:~# update-rc.d pacemaker defaults 
update-rc.d: using dependency based boot sequencing
insserv: Service corosync has to be enabled to start service pacemaker
insserv: exiting now!
update-rc.d: error: insserv rejected the script header

I've followed the guide on clusterlabs but I can't find a solution for
Debian and crmsh (on the official guide they use pcs instead of crmsh, but
even with that I could not find the correct procedure to make the cluster
run at boot time)

Another info I can add is, I've also tried to use crmsh to start and run
the cluster, trying to find a way to make it run at boot time.
If i run crm cluster start (instead of the init.d scripts) corosync and
pacemaker start and the cluster starts running, but if i run the command to
stop I get this error

crm(live)# cluster stop
ERROR: cluster.stop: Failed to stop pacemaker service:

What is the correct way to make the cluster run at boot time? 
What daemon must be started and enabled?

Should pacemaker be started by corosync? I've found this guide but had that
parameter doesn't work in my corosync configuration.

Hope somebody could help me with this issue
Thanks in advance

More information about the Users mailing list