|
Two hosts are CentOS system, host names are node0 and node1, node0 The IP 10.141.4.36, node1 The IP 10.141.4.39, both hosts are using the user name cluster. node0 as an NFS server side, node1 as an NFS client.
1. Perform the following operation on node0 and node1:
Add the following to the / etc / hosts file:
10.141.4.36 node0
10.141.4.39 node1
2. node0 configuring NFS server will shut down the firewall and permanently closed:
sudo service iptables stop
sudo chkconfig iptables off
View the status of rpcbind and nfs:
sudo service rpcbind status
sudo service nfs status
If the results show does not start, start, and set to boot:
sudo service rpcbind start
sudo service nfs start
sudo chkconfig rpcbind on
sudo chkconfig nfs on
Create a shared directory:
mkdir / home / cluster / mirror
Add to / etc / exports file the following lines (note no spaces between brackets each configuration item, in addition no_root_squash configuration items that must, otherwise when the NFS client to mount the shared directory, there will be the problem of insufficient permissions ):
/ Home / cluster / mirror node1 (rw, async, no_root_squash)
Validate the configuration:
sudo exportfs -rv
3. node1 configure NFS Client
View to mount folder:
showmount -e node0
Create the mount point:
mkdir / home / cluster / mirror
Mount the shared directory node0:
sudo mount -t nfs node0: / home / cluster / mirror / home / cluster / mirror
Check whether the mount was successful:
df
Set the boot automatically mount, add the following line to the /etc/rc.local file, to note here is usually set boot automatically mount file systems are configured through the / etc / fstab file to achieve, but because the system boot process, implementation of this document earlier than network enabled, so NFS can not automatically mount the boot configuration file to achieve this:
mount -t nfs -o nolock node0: / home / cluster / mirror / home / cluster / mirror
Reboot the system, if successfully mounted the node0 the / home / cluster / mirror directory, the installation was successful. |
|
|
|