Formatting the Disks Attached to an NFS Server
If you use SFS Turbo to provide shared file storage, skip this section. For details about how to mount the backup volumes, see section Formatting a Disk in the SAP HANA User Guide.
The NFS server disks are available only after they are formatted and mounted to the required directory.
Procedure
- Format the disks attached to an NFS server.
- Log in to an NFS server.
- Run the following command to view the disks that are not formatted:
fdisk -l
- Run the following commands to partition the disk:
parted /dev/xvdd mklabel gpt y
parted /dev/xvdd mkpart primarty 0% 100%
- Set the file system of the created partition. Run the following command to set the file system format of the created partition to ext3:
mkfs -t ext3 /dev/xvdd1
- Attach the disk to the /backup directory.
- Run the following command to create the /backup directory:
mkdir /backup
- Run the following command to attach the disk to the required directory:
mount /dev/xvdd1 /backup
- Write disk attaching relationships into the /etc/fstab file.
Perform this operation so that the disk can be automatically attached to the NFS server when the NFS server restarts.
- Run the following command to check the UUID of the disk:
ll /dev/disk/by-uuid/
- Open the file, enter the editing mode, and add an empty row.
vi /etc/fstab
- Replace the empty row with the following content:
UUID=8cbc7aa5-9110-4ff2-a15e-7170d9c45b8f /backup ext3 defaults 0 0
- Run the following command to create the /backup directory:
- Configure and restart the NFS server.
- Open the /etc/sysconfig/nfs file and enter the editing mode to set the ports of the NFS server.
vi /etc/sysconfig/nfs
- Configure the data as follows:
....
MOUNTD_PORT="4002"
....
STATD_PORT="4000"
....
LOCKD_TCPPORT="4001"
....
LOCKD_UDPPORT="4001"
- Open the /etc/exports file.
The purpose of editing the file is to share the disks on the NFS server to all SAP HANA nodes.
vi /etc/exports
- Add the sharing record.
The format is Shared directoryHosts that can access the shared directory (option).
Take the IP address 10.0.1.2 of the cloud management/backup plane for the BMS as an example.
/backup 10.0.1.2(rw,sync,no_root_squash,no_subtree_check)
You need to add the sharing records of the SAP application instance nodes and SAP application nodes.
- Run the following command to make the configuration in the /etc/exports file take effect:
exportfs -a
- Run the following command to restart the NFS server:
systemctl restart nfsserver
- Run the following command to check whether the shared directory is successfully set. If the directory information is displayed in the command output, the setting is successful.
showmount -e
- Run the following command to set the automatic startup of the NFS server:
systemctl enable nfsserver
- Run the following command to check the NFS server status:
If the status of Active is active, the NFS server is started normally.
systemctl status nfsserver
- Open the /etc/sysconfig/nfs file and enter the editing mode to set the ports of the NFS server.
- Log in to the BMS and SAP application nodes and attach the backup volume to the SAP application nodes.
- Run the following command to create the /hana/backup directory:
mkdir -p /hana/backup
- Run the following command to assign permissions to /backup:
chmod -R 777 /hana/backup
- Attach the backup volume to the /hana/backup directory on the SAP node.
Take the NFS server with IP address 10.0.1.101 as an example.
mount -t nfs -o vers=3 10.0.1.101:/backup /hana/backup
- Write disk attaching relationships into the /etc/fstab file.
Open the file and add the following content:
10.0.1.101:/backup /hana/backup nfs defaults 0 0
- Run the following command to create the /hana/backup directory:
Last Article: Formatting a Disk
Next Article: Formatting a BMS Disk
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.