Configuring HA on NFS Servers
Scenarios
If you use SFS Turbo to provide shared file storage, skip this section.
When NFS servers are deployed to work in active/standby mode, you must enable data synchronization on the NFS servers so that they can properly support the SAP system.
Prerequisites
You have configured NFS servers to be trusty to each other and formatted the disks attached to NFS servers. For details, see sections Configuring NFS Servers to Be Trusty to Each Other and Formatting the Disks Attached to an NFS Server.
Procedure
- Initialize the cluster.
- Log in to the jump host. Ensure that user root and key file are used for authentication. Then, use SSH to switch to the active NFS server. The name of the NFS server is assumed to nfs01.
- Run the following command on the active NFS server to enter the cluster configuration page:
ha-cluster-init
- When the system displays the following information, enter y and press Enter:
WARNING: NTP is not configured to start at system boot. WARNING: No watchdog device found. If SBD is used, the cluster will be unable to start without a watchdog. Do you want to continue anyway? [y/N]
- When the system displays the following information, enter n and press Enter:
/root/.ssh/id_rsa already exists - overwrite? [y/N]
- Enter the heartbeat network segment of the NFS server and press Enter.
Take network segment 10.0.4.0 as an example:
Network address to bind to (e.g.: 192.168.1.0) []
- When the system displays the following information, retain the default settings and press Enter:
Multicast address (e.g.: 239.x.x.x) [239.97.171.218]
- When the system displays the following information, retain the default settings and press Enter:
Multicast port [5405]
- When the system displays the following information, enter n and press Enter:
Do you wish to use SBD? [y/N]
- When the system displays the following information, enter n and press Enter:
To ensure system security, change the hacluster password after configuring HA.
... Log in with username 'hacluster', password 'linux' WARNING: You should change the hacluster password to something more secure! Enabling pacemaker.service Waiting for cluster........done Loading initial configuration ... Do you wish to configure an administration IP? [y/N] - During the cluster initialization, the system displays the following information:
Done (log saved to /var/log/ha-cluster-bootstrap.log)
- Add the standby NFS server to the cluster.
- On the active NFS server nfs01, synchronize the corosync.conf configuration file to the standby NFS server.
The command is in the following format:
scp /etc/corosync/corosync.conf Name of the standby NFS server:/etc/corosync/
The following command is used as an example:
scp /etc/corosync/corosync.conf nfs02:/etc/corosync/
- Log in to the standby NFS server from the active one using SSH.
ssh nfs02
- Run the following command to add the standby NFS server to the cluster:
ha-cluster-join
- When the system displays the following information, enter y and press Enter:
WARNING: NTP is not configured to start at system boot. WARNING: No watchdog device found. If SBD is used, the cluster will be unable to start without a watchdog. Do you want to continue anyway? [y/N]
- When the system displays the following information, enter the heartbeat plane IP address of the active NFS server, for example, 10.0.4.101, and press Enter:
IP address or hostname of existing node (e.g.: 192.168.1.1) []
- When the system displays the following information, enter n and press Enter:
/root/.ssh/id_rsa already exists - overwrite? [y/N]
- During the cluster initialization after the standby NFS server is added to the cluster, the system displays the following information:
...... WARNING: You should change the hacluster password to something more secure! Enabling pacemaker.service Waiting for cluster........done Done (log saved to /var/log/ha-cluster-bootstrap.log)
- On the active NFS server nfs01, synchronize the corosync.conf configuration file to the standby NFS server.
- Configure basic cluster parameters.
- Use VNC and user root password to log in to the active NFS server as user root and switch to the CLI mode.
- Run the yast2 command to enter the YaST2 Control Center page. Figure 1 YaST2 Control Center page
- Choose . The system displays a message, asking you to install the hawk software package, as shown in Figure 2. Select Cancel and press Enter.
- The system displays the message "If you continue without installing required packages, YaST may not work properly." Select Continue and press Enter. The configuration information page of the cluster is displayed.
- On the left side of the page, choose . Then, configure parameters on the right side of the page. Figure 3 shows an example.
Set the parameters as follows:
- Transport: Set this parameter to Unicast.
- In the Channel pane, select the network segment for the NFS server heartbeat link, which is the network segment of the heartbeat plane, for example, 10.0.4.0, for Bind Network Address; retain the default setting of Multicast Port.
- Auto Generate Node ID: Select this parameter.
- Redundant Channel: You do not need to configure this parameter.
- Member Address: Select Add to add the heartbeat plane IP addresses of the active and standby NFS servers to Member Address.
- On the left side of the page, choose . Then, configure parameters on the right side of the page.
Enable Security Auth: Select this parameter.
Select Generate Auth Key File and press Enter. In the dialog box showing the file generation message, select OK and press Enter to generate the authentication key file.
Figure 4 Security page
- On the left side of the page, choose . Then, configure parameters on the right side of the page.
Select a Sync Host node and Generate Pre-Shared-Keys and press Enter to generate the file. In addition, ensure that Turn csync2 OFF in the lower right corner of the page is displayed, indicating that Csync2 has been enabled.
Figure 5 Configure Csync2 page
- On the left side of the page, choose . Then, configure parameters on the right side of the page.
Set the parameters as follows:
- Booting: On is selected by default, which indicates that the cluster is automatically started when the server starts.
- Switch on and off: Ensure that the cluster has been started.
- Firewall Settings: Ensure that Firewall is disabled is selected.
Figure 6 Service page
- Select Finish and press Enter to complete the configuration.
- Copy the key_hagroup and csync2.cfg files on the active NFS server to the standby NFS server.
Log in to the active NFS server as user root and run the following command:
scp /etc/csync2/key_hagroup /etc/csync2/csync2.cfg Name of the standby NFS server:/etc/csync2
The following command is used as an example:
scp /etc/csync2/key_hagroup /etc/csync2/csync2.cfg nfs02:/etc/csync2
- Run the following commands on the active NFS server:
systemctl enable csync2.socket
systemctl enable xinetd
systemctl restart xinetd
- Log in to the standby NFS server as user root and
run the following commands:
systemctl enable csync2.socket
systemctl enable xinetd
systemctl restart xinetd
- Run the following command on the active NFS server to synchronize the configuration file:
csync2 -xv
- Run the following command on the active NFS server to check the cluster status:
Ensure that the cluster status is active (running).
If the command output indicating that the STONITH disk has not been configured, this is normal. The STONITH disk will be configured in the subsequent steps.
systemctl status pacemaker
- Run the following commands on the active NFS server to restart the cluster:
systemctl stop pacemaker
systemctl start pacemaker
- Run the following command on the standby NFS server to check the cluster status:
Ensure that the cluster status is active (running).
If the command output indicating that the STONITH disk has not been configured, this is normal. The STONITH disk will be configured in the subsequent steps.
systemctl status pacemaker
- Run the following commands on the standby NFS server to restart the cluster:
systemctl stop pacemaker
systemctl start pacemaker
- Run the following command on the active NFS server to check the cluster heartbeat status:
corosync-cfgtool -s
The system displays the heartbeats of the active and standby links. Ensure that the configurations are correct.
- Run the following command to check the cluster status on the active NFS server:
crm_mon -r1
The terminal display is as follows, where two NFS servers are in Online state, indicating that the cluster is functional:
Last updated: Wed Oct 19 17:40:31 2016 Last change: Tue Oct 18 15:32:00 2016 by root via cibadmin on hana01 Stack: classic openais (with plugin) Current DC: nfs01 - partition with quorum Version: 1.1.12-f47ea56 2 Nodes configured, 2 expected votes 0 Resources configured Online: [ nfs01 nfs02 ]
- Configure the softdog.
- Run the following command on the active NFS server to open the file and enter i to enter editing mode:
vi /etc/init.d/boot.local
- Add the following information to the last line of the file:
modprobe softdog >/dev/null 2>&1
- Press Esc, enter :x!, and press Enter to exit the configuration.
- On the CLI, run the following command:
modprobe softdog
- Repeat steps 4.a to 4.d to configure the softdog on the standby NFS server.
- Run the following command on the active NFS server to open the file and enter i to enter editing mode:
- Configure SBD on the Fence devices.
- Run the following command on the active and standby NFS servers to start the SBD service automatically once the active and standby NFS servers start:
systemctl enable sbd
- Run the following command on the active NFS server to create an SBD partition:
The command is in the following format:
sbd -d /dev/disk/by-id/Partition ID create
To query an SDB disk ID, run the ll /dev/disk/by-id |grep Partition name|grep scsi-3 command. For example, if the partition name is /dev/sdb1, run the ll /dev/disk/by-id |grep sdb|grep scsi-3 command to query the ID corresponding to sdb1.
The following command is used as an example:
sbd -d /dev/disk/by-id/scsi-36888603000000db7fa179ea56210049-part1 create
- Run the following command to allocate the partition to the active NFS server:
The command is in the following format:
sbd -d /dev/disk/by-id/Partition ID allocate Active node host name
The following command is used as an example:
sbd -d /dev/disk/by-id/scsi-36888603000000db7fa179ea56210049-part1 allocate nfs01
- Run the following command to allocate the partition to the standby NFS server:
The command is in the following format:
sbd -d /dev/disk/by-id/Partition ID allocate Standby node host name
The following command is used as an example:
sbd -d /dev/disk/by-id/scsi-36888603000000db7fa179ea56210049-part1 allocate nfs02
- Run the following command to query the allocated partition:
The command is in the following format:
sbd -d /dev/disk/by-id/Partition ID list
The following command is used as an example:
sbd -d /dev/disk/by-id/scsi-36888603000000db7fa179ea56210049-part1 list
The command output is as follows:
0 nfs01 clear 1 nfs02 clear
- Run the following command to dump the partition:
sbd -d /dev/disk/by-id/Partition ID dump
The following command is used as an example:
sbd -d /dev/disk/by-id/scsi-36888603000000db7fa179ea56210049-part1 dump
- Open the sbd file and add data to the file.
Run the vi /etc/sysconfig/sbd command to open the file and add data to the file.
An example is provided as follows:
Enter the path of the partition for SBD in SBD_DEVICE. The partition in the following terminal display is for reference only.
SBD_DEVICE="/dev/disk/by-id/scsi-36888603000000db7fa179ea56210049-part1" SBD_OPTS="-W"
- On active NFS server, synchronize the configuration file to the standby NFS server.
scp /etc/sysconfig/sbd Standby node host name:/etc/sysconfig
The following command is used as an example:
scp /etc/sysconfig/sbd nfs02:/etc/sysconfig
- Run the following commands on the active NFS server to restart the cluster:
systemctl stop pacemaker
systemctl start pacemaker
- Run the following commands on the standby NFS server to restart the cluster:
systemctl stop pacemaker
systemctl start pacemaker
- Check cluster configurations.
crm_mon -r1
The terminal display is as follows, where two NFS servers are in Online state, indicating that the cluster is functional:
Last updated: Wed Oct 19 17:40:31 2016 Last change: Tue Oct 18 15:32:00 2016 by root via cibadmin on hana01 Stack: classic openais (with plugin) Current DC: nfs01 - partition with quorum Version: 1.1.12-f47ea56 2 Nodes configured, 2 expected votes 0 Resources configured Online: [ nfs01 nfs02 ]
- Run the following command on the active and standby NFS servers to start the SBD service automatically once the active and standby NFS servers start:
- Add Fence SBD resources.
- Run the following command on the active NFS server to switch to the CRM configuration mode:
crm
Information similar to the following is displayed:
crm(live)#
- Run the following command to switch to the configuration mode:
configure
- Run the following commands to add SBD resources:
primitive r_sbd stonith:external/sbd params pcmk_delay_max=40
commit
- Run the following command on the active NFS server to switch to the CRM configuration mode:
- Assign a virtual service IP address.
- On the management console, click Service List and choose Computing > Elastic Cloud Server to switch to the Elastic Cloud Server page.
- Locate the ECS on which an NFS server is deployed and click the ECS name. Then, the page for the ECS details is displayed.
- Click the NIC tab and then Manage Private IP in the row of the server or management plane NIC. Then, the system displays the Virtual IP Address page.
- Click Assign Virtual IP Address to assign a floating IP address. Locate the row that contains the target IP address, click Bind to Server to bind the IP address to the target ECS, and repeat this operation to bind the IP address to other ECSs.
- Run the following commands on the active NFS server in CRM configuration mode:
In the preceding commands, params ip is the virtual service IP address of the NFS server. This value is for reference only.
primitive nfs_vip ocf:heartbeat:IPaddr2 params ip=10.0.1.103 op monitor interval="10" timeout="20" on-fail=restart
commit
- Create cluster shared volume file systems.
Run the following commands on the active NFS server to create the cluster shared disk file system for the backup volume:
In the commands, params device and directory specify the ID and path of the backup volume, and the values provided are for reference only. For instructions about how to query a disk ID, see 5.b.
primitive nfs_bak ocf:heartbeat:Filesystem params device="/dev/disk/by-id/Volume ID" directory="/backup" fstype=ext3 op monitor interval="10" timeout="40" on-fail=restart
primitive nfs_sapmnt ocf:heartbeat:Filesystem params device="/dev/disk/by-id/Volume ID" directory="/sapmnt " fstype=ext3 op monitor interval="10" timeout="40" on-fail=restart
primitive nfs_sys ocf:heartbeat:Filesystem params device="/dev/disk/by-id/Volume ID" directory="/usr/sap/A01/SYS" fstype=ext3 op monitor interval="10" timeout="40" on-fail=restart
primitive nfs_sapcd ocf:heartbeat:Filesystem params device="/dev/disk/by-id/Volume ID" directory="/sapcd" fstype=ext3 op monitor interval="10" timeout="40" on-fail=restart
commit
- Create the nfsserver resource.
In the CRM configuration mode on the active NFS server, create the nfsserver resource.
If the floating IP address (specified by nfs_ip) of the NFS server is 10.0.1.103, run the following commands:
primitive nfsserver nfsserver params nfs_ip=10.0.5.103 nfs_shared_infodir="/backup" nfs_shared_infodir="/sapmnt" nfs_shared_infodir="/usr/sap/A01/SYS" nfs_shared_infodir="/sapcd" operations $id=nfsserver-operations op monitor interval="10" timeout="20" on-fail=restart
commit
- Create the resource group nfs_group.
Run the following commands on the active NFS server in the CRM configuration mode to create resource group nfs_group for the resource created from 7.e to 9:
group nfs_group nfs_vip nfs_bak nfs_sapmnt nfs_sys nfs_sapcd nfsserver
commit
- Create Clone Ping.
Run the following commands on the active NFS server in the CRM configuration mode to create Clone Ping:
primitive r_ping ocf:pacemaker:ping params multiplier="100" dampen="5" host_list="10.0.5.1" op monitor interval="15" timeout="60" start="60" op start interval="0" timeout="60"
clone PING r_ping
commit
Set the parameters as follows:
- r_ping: specifies the Clone Ping resource name.
- Multiplier: an efficiency enhancer that uses the benchmark of 100. When packet loss occurs during the ping operation between two nodes, the multiplier decreases a certain value from 100 to determine the service NIC communication status of the nodes.
- dampen: indicates that the ping operation is performed once every 5s.
- 10.0.5.1: indicates the gateway IP address of the server or backup plane network segment for the NFS servers.
- monitor: indicates monitoring resources. interval: indicates that if pinging the upper-layer switch fails within 15s, the system will migrate resources at most 60s (timeout) later.
- Create restraint nfs_conn.
Run the following commands on the active NFS server in the CRM configuration mode to create restraint nfs_conn on resource group nfs_group:
location nfs_conn nfs_group rule -inf: not_defined pingd or pingd lte 0
commit
- Configure other information.
- Configure the stonith parameter:
property startup-fencing=true
property stonith-enabled=true
property stonith-action=off
commit
- Configure the failure timeout duration:
rsc_defaults failure-timeout=600
commit
- Press Ctrl+C on the active NFS server to exit the CRM configuration mode.
- Configure the stonith parameter:
Last Article: Formatting the Disks Attached to an NFS Server
Next Article: Attaching the Backup Volume


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.