next up previous
Next: Mounting partitions Up: HA and heartbeat Previous: ha.cf

resources

Then we need to set up the resources file /etc/ha.d/resources. The comments in the file tell how to configure it.

#
# This is a list of resources that move from machine to machine as
# nodes go down and come up in the cluster. Do not include
# "administrative" or fixed IP addresses in this file.
#
# <VERY IMPORTANT NOTE>
# The haresources files MUST BE IDENTICAL on all nodes of the cluster.
#
# The node names listed in front of the resource group information
# is the name of the preferred node to run the service. It is
# not necessarily the name of the current machine. If you are running
# nice_failback OFF then these services will be started
# up on the preferred nodes - any time they're up.
#
# If you are running with nice_failback ON, then the node information
# will be used in the case of a simultaneous start-up.
#
# BUT FOR ALL OF THESE CASES, the haresources files MUST BE IDENTICAL.
# If your files are different then almost certainly something
# won't work right.
# </VERY IMPORTANT NOTE>
#
#
# <snip extensive comments>
campeche IPaddr::192.168.1.1/24/eth1 IPsrcaddr::192.168.1.1 datadisk::drbd0 remount cyrus
nmb portmap saslauthd snmpd sysMonitor dracd ldap named postgresql sessiond amavis cups
groupware slurpd suad dycemessengerserver postfix smb webmail fetchd mailgraph apache atd
cron dhcpd fam nscd tomcat

You can see almost every service is listed here. Many are simply programs that we start when the node takes over as primary. IPaddr manages the shared IP alias assigned to the master. IPsrcaddr is a script that manages the preferred source address associated with packets which originate on the localhost and are routed through the default route. Datadisk loads and unloads the drbd module. Remount is my custom script to bind mount mirrored mount points.

When the secondary is inactive almost nothing is running.

chihuahua: # ps ax
PID TTY STAT TIME COMMAND
1 ? S 0:04 init
2 ? SW 0:00 [migration_CPU0]
3 ? SW 0:00 [migration_CPU1]
4 ? SW 0:00 [migration_CPU2]
5 ? SW 0:00 [migration_CPU3]
6 ? SW 0:00 [keventd]
7 ? SWN 0:02 [ksoftirqd_CPU0]
8 ? SWN 0:00 [ksoftirqd_CPU1]
9 ? SWN 0:00 [ksoftirqd_CPU2]
10 ? SWN 0:00 [ksoftirqd_CPU3]
11 ? SW 0:00 [kswapd]
12 ? SW 0:00 [bdflush]
13 ? SW 0:02 [kupdated]
14 ? SW 0:00 [kinoded]
15 ? SW 0:00 [mdrecoveryd]
24 ? SW 0:00 [scsi_eh_0]
28 ? SW 0:00 [kreiserfsd]
87 ? SW< 0:00 [lvm-mpd]
417 ? S 0:00 /sbin/syslogd -a /var/lib/dhcp/dev/log -a /var/named/
420 ? S 0:00 /sbin/klogd -c 1 -2
456 ? SW 0:00 [khubd]
663 ? SW 0:26 [drbdd_0]
680 ? SW 0:07 [drbd_asender_0]
705 ? S 0:00 /usr/sbin/snmpd -c /etc/snmpd.conf -r -A -l /var/log/
756 ? S 0:00 /usr/sbin/sshd
980 ? SL 0:02 heartbeat: heartbeat: control process
994 ? SL 0:02 heartbeat: heartbeat: write: ucast eth0 172.16.1.1
995 ? SL 0:07 heartbeat: heartbeat: read: ucast eth0 172.16.1.1
996 ? SL 0:23 heartbeat: heartbeat: master status process
1090 ? S 0:00 /usr/X11R6/bin/xfs -nodaemon -user nobody -port 7100
1107 ? SL 0:00 /usr/sbin/ntpd -U ntp
1119 ? S 0:00 /usr/bin/ksysguardd -d
1132 tty1 S 0:00 /sbin/mingetty -noclear tty1
1133 tty2 S 0:00 /sbin/mingetty tty2
1134 tty3 S 0:00 /sbin/mingetty tty3
1135 tty4 S 0:00 /sbin/mingetty tty4
1136 tty5 S 0:00 /sbin/mingetty tty5
1137 tty6 S 0:00 /sbin/mingetty tty6
4140 ? S 0:00 /usr/sbin/sshd
4141 pts/0 S 0:00 -bash
4163 pts/0 R 0:00 ps ax

In comparison, the active machine campeche, has 244 processes active.


next up previous
Next: Mounting partitions Up: HA and heartbeat Previous: ha.cf