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


About Us

Contact Us

Legal Info

How To Contribute

Security Issues

This web page is no longer maintained. Information presented here exists only to avoid breaking historical links.
The Project stays maintained, and lives on: see the Linux-HA Reference Documentation.
To get rid of this notice, you may want to browse the old wiki instead.

1 February 2010 Hearbeat 3.0.2 released see the Release Notes

18 January 2009 Pacemaker 1.0.7 released see the Release Notes

16 November 2009 LINBIT new Heartbeat Steward see the Announcement

Last site update:
2020-07-08 07:25:47

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.


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

See Also