==========The following operations operate on a (shared) network file server (210)====================
1. Check whether the nfs service is installed on the machine. If it is not installed online: yum -y install nfs-*
--Check if the service exists: ll /etc/init.d/nfs
2. Increase the mount configuration
vi /etc/exports
Add configuration:
/tmp/image 192.168.0.*(rw,sync)
Make the configuration take effect (mostly used when the nfs service starts, modifying the configuration needs to be reloaded)
exportfs -a
Give maximum permissions to the owner of the shared directory to prevent clients without delete or write permissions
chmod 777 /tmp/image
3. Configuration service
a. Modify the /etc/sysconfig/nfs file and remove the comments from the following:
LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
RQUOTAD_PORT=875
STATD_PORT=662
STATD_OUTGOING_PORT=2020
b. Open the firewall and increase the opening of relevant ports:
#portmap
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
#nfsd
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
#lockd
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
#mountd
-A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT
#rquotad
-A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT
#statd
-A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT
c. Restart the service
service rpcbind restart
service nfs restart
d. The service starts automatically after booting
chkconfig nfs on
==========The following operations operate on other required servers(*)====================
1. Install the dependent tools required for mounting
Online installation: yum -y install nfs-utils
2. Execute the mount command:
mount 192.168.0.210:/tmp/image /image/thumb
You can write the above command to /etc/rc.local to achieve the purpose of automatic mounting at boot
3. Check whether the mount is successful: df -h