• No results found

Note: Installing Software Packages on All Parties

The software packages needed for High Availability clusters are not automatically copied to the cluster nodes.

4. Install the High Availability pattern on all machines that will be part of your cluster.

If you do not want to install SUSE Linux Enterprise Server 12 SP1 and SUSE Linux Enterprise High Availability Extension 12 SP1 manually on all nodes that will be part of your cluster, use AutoYaST to clone existing nodes. For more information, refer to Section 3.6, “Mass Deployment with AutoYaST”.

27 Automatic Cluster Setup (ha-cluster-bootstrap) SLE HA 12 SP1

3.4 Automatic Cluster Setup (ha-cluster-bootstrap)

The ha-cluster-bootstrap package provides everything you need to get a one-node cluster up and running, to make other nodes join, and to remove nodes from an existing cluster:

Automatically Setting Up the First Node

With ha-cluster-init, define the basic parameters needed for cluster communication and (optionally) set up a STONITH mechanism to protect your shared storage. This leaves you with a running one-node cluster.

Adding Nodes to an Existing Cluster

With ha-cluster-join, add more nodes to your cluster.

Removing Nodes From An Existing Cluster

With ha-cluster-remove, remove nodes from your cluster.

All commands execute bootstrap scripts that require only a minimum of time and manual intervention. The bootstrap scripts for initialization and joining automatically open the ports in the firewall that are needed for cluster communication. The configuration is written to / etc/sysconfig/SuSEfirewall2.d/services/cluster. Any options set during the bootstrap process can be modified later with the YaST cluster module.

Before starting the automatic setup, make sure that the following prerequisites are fulfilled on all nodes that will participate in the cluster:

PREREQUISITES

The requirements listed in Section  2.2, “Software Requirements” and Section  2.4, “Other Requirements and Recommendations” are fulfilled.

The ha-cluster-bootstrap package is installed.

The network is configured according to your needs. For example, a private network is available for cluster communication and network device bonding is configured. For information on bonding, refer to Chapter 12, Network Device Bonding.

28 Automatic Cluster Setup (ha-cluster-bootstrap) SLE HA 12 SP1

If you want to use SBD for your shared storage, you need one shared block device for SBD.

The block device need not be formatted. In addition, you will need a suitable hardware watchdog device. For more information, refer to Chapter 19, Storage Protection.

All nodes must be able to see the shared storage via the same paths ( /dev/disk/by-path/... or /dev/disk/by-id/...).

PROCEDURE 3.2: AUTOMATICALLY SETTING UP THE FIRST NODE

The ha-cluster-init command checks for configuration of NTP and guides you through configuration of the cluster communication layer (Corosync). Optionally, it lets you configure the following:

SBD

A fencing mechanism to protect your shared storage. For details on SBD, see Chapter 19, Storage Protection.

Virtual IP

A virtual IP address for Hawk. For details on Hawk, see Chapter 6, Configuring and Managing Cluster Resources (Web Interface).

Shared Storage with OCFS2

When running the script with the -t option, it can perform additional cluster configuration based on templates. For example, ha-cluster-init -t ocfs2 will partition some shared storage into two pieces: 1 MB for SBD, and the remainder for OCFS2.

For details about the script's range of functions, its options, and an overview of the files it can create and modify, refer to the ha-cluster-init man page.

1. Log in as root to the physical or virtual machine you want to use as cluster node.

2. Start the bootstrap script by executing

root # ha-cluster-init

If NTP has not been configured to start at boot time, a message appears. The script also checks for a hardware watchdog device (which is important in case you want to configure SBD) and warns you if none is present.

If you decide to continue anyway, the script will automatically generate keys for SSH access and for the Csync2 synchronization tool and start the services needed for both.

29 Automatic Cluster Setup (ha-cluster-bootstrap) SLE HA 12 SP1 3. To configure the cluster communication layer (Corosync):

a. Enter a network address to bind to. By default, the script will propose the network address of eth0. Alternatively, enter a different network address, for example the address of bond0.

b. Enter a multicast address. The script proposes a random address that you can use as default.

c. Enter a multicast port. The script proposes 5405 as default.

4. To configure SBD (optional), enter a persistent path to the partition of your block device that you want to use for SBD. The path must be consistent across all nodes in the cluster.

Finally, the script will start the Pacemaker service to bring the one-node cluster online and enable the Web management interface Hawk. The URL to use for Hawk is displayed on the screen.

5. To configure a virtual IP address for cluster administration, enter yes when prompted and enter an unused IP address that you want to use as administration IP for the cluster.

Instead of logging in to an individual cluster node with Hawk, you can then connect to the virtual IP address.

6. For any details of the setup process, check /var/log/ha-cluster-bootstrap.log. You now have a running one-node cluster. Check the cluster status with crm status:

root # crm status

Last updated: Thu Jul 3 11:04:10 2014 Last change: Thu Jul 3 10:58:43 2014

Current DC: alice (175704363) - partition with quorum 1 Nodes configured

0 Resources configured

Online: [ alice ]

30 Automatic Cluster Setup (ha-cluster-bootstrap) SLE HA 12 SP1