All commands or steps:
First, install the NFS service on each node
Yum install-y NFS
Service Rpcbind Start
Service NFS Start
Edit the/etc/exports file and add the following line
/mnt/share Hadoop1 (Rw,no_root_squash,async) hadoop2 (Rw,no_root_squash,async) HADOOP6 (Rw,no_root_squash,async) HADOOP7 (Rw,no_root_squash,async)
Indicates that the following four hosts have read and write access to the shared directory/mnt/share.
Add the following lines in the Hdfs-site.xml
< Property> <name>Dfs.namenode.shared.edits.dir.ns1</name> <value>File:///root/softs/hadoop-2.7.3/sharelogs/eidts_ns1</value> </ Property> < Property> <name>Dfs.namenode.shared.edits.dir.ns2</name> <value>File:///root/softs/hadoop-2.7.3/sharelogs/eidts_ns2</value> </ Property>
mount a shared directory on a node that needs to use a shared directory
Mount-t NFS Hadoop1:/mnt/share sharelogs/
Mount-t NFS Hadoop2:/mnt/share sharelogs/
Mount-t NFS Hadoop6:/mnt/share sharelogs/
Mount-t NFS Hadoop7:/mnt/share sharelogs/
Other specific configurations refer to the Hadoop official documentation
Configuring NFS as an HDFS high-availability shared storage System