This topic describes how to deploy NFS as the backup destination.
Background
We recommend that you use OSS devices or dedicated NFS devices, for example, NFS devices provided by Alibaba Cloud.
Deploy the NFS server
Log on to the NFS server.
Run the following command to install NFS by using the YUM package manager.
sudo yum install nfs-utilsConfigure the exports file.
Run the
sudo vim /``etc/exportscommand to access the configuration file and set the following information:/data/nfs_server/ 100.xx.xx.xx/16(rw,sync,all_squash)100.``xx.xx.xxindicates the accessible CIDR block.Run the following command to grant privileges to
nfsnobody, allowingnfsnobodyto access the directory specified in theexportsfile.sudo chown nfsnobody:nfsnobody -R /data/nfs_server
Set the NFS parameters.
Run the
sudo vim /etc/sysconfig/nfscommand to access the configuration file.Set the parameters as follows:
RPCNFSDCOUNT=8 RPCNFSDARGS="-N 2 -N 3 -U" NFSD_V4_GRACE=90 NFSD_V4_LEASE=90Run the following command to restart NFS.
sudo systemctl restart nfs-config sudo systemctl restart nfs-server
Set the slot table.
Run the
sudo vim /etc/sysctl.confcommand to access thesysctl.conffile and add the following information:sunrpc.tcp_max_slot_table_entries=128Restart the server for the configurations to take effect.
Deploy the NFS client
The NFS client must be deployed on all OBServers.
This section describes how to deploy the NFS client on an OBServer.
Log on to the OBServer.
Run the following command to install NFS by using the YUM package manager.
sudo yum install nfs-utilsSet the slot table.
Run the
sudo vim /etc/sysctl.confcommand to access thesysctl.conffile and add the following information:sunrpc.tcp_max_slot_table_entries=128Restart the server for the configurations to take effect.
Run the following command to mount NFS.
sudo mount -tnfs4 -o rw,timeo=30,wsize=1048576,rsize=1048576,namlen=512,sync,lookupcache=positive 100.xx.xx.xx:/data/nfs_server /data/nfsNote
We recommend that you set
timeoto an appropriate value.100.xx.xx.xxindicates the IP address of the NFS server.
Run the following command to verify the performance of NFS.
fio -filename=/data/nfs/fio_test -direct=1 -rw=randwrite -bs=2048K -size=100G -runtime=300 -group_reporting -name=mytest -ioengine=libaio -numjobs=1 -iodepth=64 -iodepth_batch=8 -iodepth_low=8 -iodepth_batch_complete=8For example, the command output is as follows:
Run status group 0 (all jobs): WRITE: io=322240MB, aggrb=1074.2MB/s, minb=1074.2MB/s, maxb=1074.2MB/s, mint=300006msec, maxt=300006msec
Note
If you use an NFS environment, make sure that you have mounted NFS before enabling the backup service. If NFS fails during backup, stop data backup and log backup first and then resolve the NFS issue.
When you restart an OBServer, you need to start NFS first.
After you add a new server, make sure that you have mounted NFS or you are able to back up data to another media before you start the new OBServer.