Initial Configuration

From Cluster Labs

Jump to: navigation, search

Contents

Basic Stack Configuration

Heartbeat

Sample /etc/ha.d/ha.cf configuration file

 # Logging
 debug				1
 use_logd			false
 logfacility			daemon
 
 # Misc Options
 traditional_compression 	off
 compression			bz2
 coredumps			true
 
 # Communications
 udpport			691
 bcast				eth0
 autojoin			any
   
 # Thresholds (in seconds)
 keepalive			1
 warntime			6
 deadtime			10
 initdead			15

For more details on these and other available options, please refer to http://www.linux-ha.org/ha.cf

CoroSync

Before starting CoroSync for the first time, you need to create the authkey-file for authentication within cluster communication.

Create /etc/corosync/authkey
corosync-keygen #no arguments required

Then you need to copy that file to all of your nodes and put it in /etc/corosync/ with user=root, group=root and mode 0400.

Example /etc/corosync/corosync.conf configuration file
  totem {
 
 	version: 2
 
 	# How long before declaring a token lost (ms)
 	token:          5000
 
 	# How many token retransmits before forming a new configuration
 	token_retransmits_before_loss_const: 20
 
 	# How long to wait for join messages in the membership protocol (ms)
 	join:           1000
 
 	# How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)
 	consensus:      7500
 
 	# Turn off the virtual synchrony filter
 	vsftype:        none
 
 	# Number of messages that may be sent by one processor on receipt of the token
 	max_messages:   20
 
 	# Disable encryption
 	secauth:	off
 
 	# How many threads to use for encryption/decryption
 	threads:   	0
 	
 	# Limit generated nodeids to 31-bits (positive signed integers)
 	clear_node_high_bit: yes
 	
 	# Optionally assign a fixed node id (integer)
 	# nodeid:         1234
 
 	interface {
 		ringnumber: 0
 
 		# The following three values need to be set based on your environment
 		bindnetaddr: 10.0.0.1
 		mcastaddr: 226.94.1.1
 		mcastport: 5405
 	}
 }
 
 logging {
 	fileline: off
 	to_syslog: yes
 	to_stderr: no
 	syslog_facility: daemon
 	debug: on
 	timestamp: on
 }
 
 amf {
 	mode: disabled
 }

Enabling Pacemaker

Heartbeat

Add the following to /etc/ha.d/ha.cf

 crm yes

or, if you plan to enable STONITH

 crm respawn

CoroSync

To instruct CoroSync to start Pacemaker, add the following fragment to corosync.conf

 service {
 	# Load the Pacemaker Cluster Resource Manager
 	name: pacemaker
 	ver:  0
 }


Additionally, it is required is to tell CoroSync to run as root (so that the processes it spawns to manage resources also has root privileges). To do this, add the following to the top of /etc/corosync/corosync.conf

 aisexec {
 	user:	root
 	group:	root
 }

A Special Note for People Switching Cluster Stacks

CoroSync and Heartbeat identify nodes differently. This is reflected in the value of 'id' for 'node' objects in the CIB.

Since 'id' is the attribute by which a node is identified, this can lead to each node having duplicate entries in the CIB's 'nodes' section and cause expected cluster behavior.

To prevent this, delete the contents of 'nodes' before starting up the alternative cluster stack (and remember to zap the .sig files in the same directory after you do so).

Starting the Cluster

Heartbeat

 /etc/init.d/heartbeat start

CoroSync

 /etc/init.d/corosync start

Next Steps

Try checking out some of our Documentation

Personal tools
communication