• No results found

Initial configuration of Linux-HA release 2

Chapter 4. Linux-HA release 2 installation and initial configuration

4.4 Initial configuration of Linux-HA release 2

The initial configuration is in regards to a generic setup and works on both Red Hat and SUSE. The initial configuration entails the following steps:

1. Copy the configuration files and adjust their permissions.

Copy the configuration files that come with the package, and set up the correct permission as in Example 4-41.

Example 4-41 Copying the Linux-HA initial configuration files

# cp -pi /usr/share/doc/packages/heartbeat/*.cf /etc/ha.d

# cp -pi /usr/share/doc/packages/heartbeat/authkeys /etc/ha.d

# chmod 0600 /etc/ha.d/authkeys

#

Pay attention to the chmod command. If you do not use the correct permissions on those files, Heartbeat is unable to start.

2. Set the basic configuration.

After the files are in place, make a basic configuration to start Heartbeat. The first file to change is the /etc/ha.d/ha.cf file. Example 4-42 shows the information that you must add to the /etc/ha.d/ha.cf file.

Example 4-42 /etc/ha.d/ha.cf autojoin other

node lnxsu3 lnxsu4 bcast hsi0

crm on

Setting the autojoin variable to other facilitates adding a new node to the cluster. It allows nodes outside the cluster, which are not listed in the ha.cf file, to join automatically.

In Example 4-43 on page 97, we configure the authentication keys by using the /etc/ha.d/authkeys file, which holds the cryptographic key that is used among the nodes to communicate with each other.

Broadcast device: The broadcast device used in our scenario is hsi0. This device is attached to HiperSockets and is used for internal communication.

Example 4-43 Setting the shared key for the cluster nodes auth 1

1 sha1 ha2redbook

We set the key to ha2redbook. Consider the key as a passphrase that each node uses to authenticate itself and join the cluster. You can use anything you want in that field, but you must ensure that the same passphrase is being used in all nodes of the same cluster.

3. Copy the main configuration files to the other nodes.

After making the settings in the configuration files, propagate those files among the cluster nodes. Copy the set of files to each node. We copy the files from lnxsu3 to lnxsu4, as shown in Example 4-44.

Example 4-44 Copying files from lnxsu3 to lnxsu4 lnxsu3:~ # cd /etc/ha.d

lnxsu3:/etc/ha.d # scp -p ha.cf lnxsu4:/etc/ha.d/

ha.cf 100% 10KB 10.3KB/s 00:00

lnxsu3:/etc/ha.d # scp -p authkeys lnxsu4:/etc/ha.d/

authkeys 100% 670 0.7KB/s 00:00

lnxsu3:/etc/ha.d #

4. Start the heartbeat startup daemons.

Start the heartbeat service on all member nodes of the cluster. Example 4-45 shows the start command for lnxsu3.

Example 4-45 Starting heartbeat in the first node lnxsu3:~ # service heartbeat start

Starting High-Availability servicesheartbeat[4250]:

2008/10/24_15:39:22 info: Version 2 support: on

heartbeat[4250]: 2008/10/24_15:39:22 WARN: Core dumps could be lost if multiple dumps occur.

heartbeat[4250]: 2008/10/24_15:39:22 WARN: Consider setting

non-default value in /proc/sys/kernel/core_pattern (or equivalent) for maximum supportability

heartbeat[4250]: 2008/10/24_15:39:22 WARN: Consider setting /proc/sys/kernel/core_uses_pid (or equivalent) to 1 for maximum supportability

heartbeat[4250]: 2008/10/24_15:39:22 WARN: Logging daemon is disabled --enabling logging daemon is recommended

heartbeat[4250]: 2008/10/24_15:39:22 info:

**************************

heartbeat[4250]: 2008/10/24_15:39:22 info: Configuration validated.

Starting heartbeat 2.1.3

done

lnxsu3:~ #

Example 4-46 shows the start command for lnxsu4.

Example 4-46 Starting heartbeat in the second node lnxsu4:~ # service heartbeat start

Starting High-Availability servicesheartbeat[3598]:

2008/10/24_15:40:18 info: Version 2 support: on

heartbeat[3598]: 2008/10/24_15:40:18 WARN: Core dumps could be lost if multiple dumps occur.

heartbeat[3598]: 2008/10/24_15:40:18 WARN: Consider setting

non-default value in /proc/sys/kernel/core_pattern (or equivalent) for maximum supportability

heartbeat[3598]: 2008/10/24_15:40:18 WARN: Consider setting /proc/sys/kernel/core_uses_pid (or equivalent) to 1 for maximum supportability

heartbeat[3598]: 2008/10/24_15:40:18 WARN: Logging daemon is disabled --enabling logging daemon is recommended

heartbeat[3598]: 2008/10/24_15:40:18 info:

**************************

heartbeat[3598]: 2008/10/24_15:40:18 info: Configuration validated.

Starting heartbeat 2.1.3

done

lnxsu4:~ #

5. Set up the heartbeat for startup at boot time.

Configure the heartbeat service for automatic startup during the boot process. Example 4-47 shows the settings for lnxsu3.

Example 4-47 Setting heartbeat to start at boot time for lnxsu3 lnxsu3:~ # chkconfig --list heartbeat

Example 4-48 shows the settings for lnxsu4.

Example 4-48 Setting heartbeat to start at boot time for lnxsu4 lnxsu4:/ # chkconfig --list heartbeat

To use the GUI for the Heartbeat configuration, set up a password for the haclient user. Example 4-49 shows how to set up the password for lnxsu3.

Example 4-49 Setting the hacluster account password on lnxsu3 lnxsu3:~ # passwd hacluster

Changing password for hacluster.

New Password:

Bad password: it is based on a dictionary word Reenter New Password:

Password changed.

lnxsu3:~ #

Example 4-50 shows how to set up the password for lnxsu4.

Example 4-50 Setting the hacluster account password on lnxsu4 lnxsu4:~ # passwd hacluster

Changing password for hacluster.

New Password:

Bad password: it is based on a dictionary word Reenter New Password:

Password changed.

lnxsu4:~ #

At this point, almost everything is in place to open the Linux-HA release 2 GUI and manage your cluster. You must use the Linux-HA release 2 GUI in a client running an X Server or VNC. For assistance in making VNC available, see

“Starting the GUI” on page 68.

Use the hb_gui command to open the Linux-HA release 2. After starting the hb_gui command, click the Connection menu and then the Login option. In the Login window (Figure 4-18), which prompts you for the password of the hacluster user, type the password that you created.

Figure 4-18 Initial configuration

After you enter the correct password, the next window shows the nodes that are configured in the /etc/ha.d/ha.cf file and all available fields for the configuration and management.

7. Configure Heartbeat to avoid auto-failback.

The best practice on the most common high availability scenarios is to avoid auto-failback. It makes sense because in most of cases, users prefer to understand the root cause of the failover before allowing a failback.

To avoid auto-failback for all resource groups belonging to this cluster, select the cluster and click the Configurations tab in the right pane. Change Default Resource Stickness from 0 to a higher value or set it to INFINITY, meaning the highest value possible for that field (Figure 4-19 on page 101). Click the Apply button for the new configuration to take effect.

Figure 4-19 Turning off auto-failback