LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-01-2012, 10:33 AM   #1
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
2 node clustering with corosync/pacemaker


This post may help others, who are trying to setup 2 nodes cluster for Virtual-IP, Service fail-over.

1. Install basic packages from repository
Code:
#yum install pacemaker corosync
2. Generate corosync key and place the key to all the cluster nodes under /etc/corosync with 400 permission
Code:
#corosync-keygen
3. Place the corosync.conf in /etc/corosync
Code:
 
==========================================
compatibility: whitetank
totem {
        version: 2
        token: 3000
        token_retransmits_before_loss_const: 10
        join: 60
        consensus: 3600
        vsftype: none
        max_messages: 20
        secauth: off
        threads: 0
        clear_node_high_bit: yes
        rrp_mode: none
        interface {
                 ringnumber: 0
                 bindnetaddr: network_address (This ip range need to be change according to your network setup)
                 mcastaddr: 226.94.1.1 (Change the IP based on #netstat -g result)
                 mcastport: 5405
                 ttl: 1
                 }
         }

logging {
        fileline: off
        to_stderr: no
        to_logfile: yes
        to_syslog: yes
        syslog_facility: daemon
        logfile: /var/log/cluster/corosync.log
        debug: off
        timestamp: on
        logger_subsys {
                subsys: AMF
                debug: off
                tags: enter|leave|trace1|trace2|trace3|trace4|trace6
                }
        }

 amf {
     mode: disabled
     }
=======================================
4. Place the pcmk under the following path /etc/corosync/service.d/
Code:
service{
        # Load the Pacemaker Cluster Resource Manager
        name: pacemaker
        ver: 1
}
The above is pretty much enough to configure corosync, and there are no separate config file for pacemaker & openais(everything is under corosync.conf)

5. Now start the services
/etc/init.d/corosync start (corosync must start before pacemaker)
/etc/init.d/pacemaker start

6. Verify the configuration
Code:
#crm_verify -L -V
if any errors related to stonith & quorum excute the following to avoid errors

7. Ignore the stonith
Code:
#crm configure property stonith-enabled=false
8.Ignore quorum
Code:
#crm configure property no-quorum-policy=ignore
9. For ocf scripts, Linux-ha resource-agents need to be install
Code:
#yum install resource-agents
can use some other resource agents too..
To use LSB Resource Agents
http://linux-ha.org/wiki/LSB_Resource_Agents

10. The following is the way to add and manage resources
Code:
crm configure
11. Add virtual IPv4
Code:
primitive VIPv4 ocf:heartbeat:IPaddr2 \
params ip="xx.xx.xx.xx" \
nic="bond0" \
cidr_netmask="28" \
op start interval="0s" timeout="60s" \
op monitor interval="5s" timeout="20s" \
op stop interval="0s" timeout="60s"
12. Add virtual IPv6
Code:
primitive VIPv6 ocf:heartbeat:IPv6addr \
params ipv6addr="xxxx:xxxx:xx:xx:xx:xx" \
nic="bond0" \
cidr_netmask="64" \
op start interval="0s" timeout="60s" \
op monitor interval="5s" timeout="20s" \
op stop interval="0s" timeout="60s"
13. Add Apache service
Code:
primitive HTTPD ocf:heartbeat:httpd \
params configfile="/etc/httpd/conf/httpd.conf" \
port="80" \
op start interval="0s" timeout="60s" \
op monitor interval="5s" timeout="20s" \
op stop interval="0s" timeout="60s"
14. Add group
Code:
#group webserver VIPv4 VIPv6 HTTPD
15. To prevent situation when resource apache migrate to node2 and resource IP stays at node1(It happens when apache at node1 hung but network stack works well) we need to make colocation
Code:
#crm configure colocation SPEED_TEST inf: HTTPD VIPv4 VIPv6
16. To make pacemaker start up apache only after IP is set up. In other words describe start up order run:
Code:
#crm configure order START_ORDER inf: VIPv4 VIPv6 HTTPD
17. To check cluster status
Code:
crm status
Note:- If anything wrong please correct...

Last edited by kirukan; 09-01-2012 at 10:52 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pacemaker Corosync DRBD - Problema after SplitBrain Yena Linux - Server 0 08-24-2012 01:35 AM
cluster (corosync, pacemaker, drbd, mysql) lost communication between nodes arrals.vl Linux - Server 2 05-10-2012 10:09 AM
Debian Corosync/Pacemaker Cluster Frustrations mpapet Linux - Server 1 05-09-2012 12:40 AM
MySQL HA-cluster with DRBD, Pacemaker and Corosync Patric.F Linux - Server 2 01-28-2012 05:27 AM
LXer: Openfiler 2.99 Active/Passive With Corosync, Pacemaker And DRBD LXer Syndicated Linux News 0 04-29-2011 09:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration