This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

Homepage

About Us

Contact Us

Legal Info

How To Contribute

Security Issues

21 December 2007 Heartbeat release 2.1.3 is now out Download it and install it!

11 October 2007 NEW educational HA/DR Blog hosted by Alan Robertson

9 April 2007 Check out the Cool Heartbeat Screencasts: Installation, Intro to the GUI Part of the Heartbeat Education project

Last site update:
2008-05-17 12:05:32

Configuring syslog-ng for heartbeat cluster testing with CTS

This configuration assumes that

  • your configuration of syslog-ng has the main source named src.

  • you want your various clusters to log on local5, local6, and local7.

  • your central log server is named logserver

This allows you to run tests simultaneously on three different clusters, and still keep their log files separate.

Add this to the end of /etc/syslog-ng/syslog-ng.conf on every node in the cluster.

# 
#       Heartbeat logging for CTS
#
# Basic definitions:    use port 9999 for syslog-ng logging
#                       When forwarding, forward to 'logserver'.
source s_tcp { tcp(port(9999) max-connections(32)); };
destination ha_tcp { tcp(logserver port(9999));};

#       Filters for messages on local7
filter f_ha7  { facility(local7); };
filter f_ha_tcp7  { facility(local7); };

#       Log local7 locally in /var/log/ha-log-local7, and forward to
#       'ha_tcp' from above (i.e., logserver)
destination ha_local7 { file("/var/log/ha-log-local7" perm(0644)); };
log { source(src); filter(f_ha_tcp7); destination(ha_tcp); };
log { source(src); source(s_tcp); filter(f_ha7); destination(ha_local7); };

#
# If you only want to test one cluster at a time, you can stop now...
#

#       Filters for messages on local6
filter f_ha6  { facility(local6); };
filter f_ha_tcp6  { facility(local6); };

#       Log local6 locally in /var/log/ha-log-local6, and forward to
#       'ha_tcp' from above (i.e., logserver)
destination ha_local6 { file("/var/log/ha-log-local6" perm(0644)); };
log { source(src); filter(f_ha_tcp6); destination(ha_tcp); };
log { source(src); source(s_tcp); filter(f_ha6); destination(ha_local6); };

#       Filters for messages on local6
filter f_ha5  { facility(local5); };
filter f_ha_tcp5  { facility(local5); };

#       Log local5 locally in /var/log/ha-log-local5, and forward to
#       'ha_tcp' from above (i.e., logserver)
destination ha_local5 { file("/var/log/ha-log-local5" perm(0644)); };
log { source(src); filter(f_ha_tcp5); destination(ha_tcp); };


In english, this sends everything logged to the local7 facility to the machine logserver. In addition, it will send everything logged to the local7 facility to /var/log/ha-log-local7. In the case of the machine logserver, this will include everything sent from the other cluster nodes.
NOTE: src refers to logs that originate locally on your machine. The name used in your distro may vary. To run CTS with stonith enable, syslog-ng should be started automatically before heartbeat starts.

Credits

Most of this was directly derived from AndrewBeekhof's description of how to do this.

See Also

CTS