1. NFS Server 1.1 installation
RPC Main program: Rpcbind
NFS Main program: Nfs-utils
[Email protected]~] # Rpm-qa | grep rpcbind
[Email protected]~] # RPM-QA | grep NFS
1.2 NFS Security Configuration
Firewall settings, ports for NFS service bindings
[Email protected]~] # Vi/etc/sysconfig/nfs
rquotad_port=875
lockd_tcpport=32803
lockd_udpport=32769
mountd_port=892
statd_port=662
Configure the firewall policy, open the TCP, UDP limit for the above port and 111, 2049 Port (111 is the port number of the RPC, the Service of NFS itself starts on port 2049).
1.3 Construction
1) configuration file/etc/exports
[Email protected]~] # Vi/etc/exports
/wserp/repos * (Rw,sync)
2) Start Rpcbind, NFS, Nfslock
Service Xxxstatus/start (/ETC/INIT.D/XXX)
3) Set Rpcbind, NFS, Nfslock boot
Chkconfig XXX on
1.4 Testing
Connect to view
[[Email protected]~] # showmount–e xxx
1.5 Other instructions
1) After resetting the/etc/exports file, it is not necessary to restart NFS.
# A. Re-mount the settings for/etc/exports once
[Email protected]~] # Exportfs–arv
# B. Uninstall all NFS directory resources that have been shared
[[email protected]~] # EXPORTFS–AUV
2) Shutdown precautions
When the RPC service used by NFS is connected to the server on the client, it may take longer or even several hours for the server to shut down. It is recommended that the NFS server shut down the Rpcbind and NFS two daemon before shutting down, and kill it.
2. NFS Client 2.1 Build
Start the required service Rpcbind, Nfslock, refer to section 1.3.
2.2 Mounting and unloading
1) Set up the mount point and Mount
[Email protected]~] # mount–t NFS Ip:/dir dir
View Post-mount scenarios
[[Email protected]~] # DF
2) Uninstall
[Email protected]~] # umount dir
3) Boot mount
Edit the file /etc/rc.d/rc.localand add the attached command.
NFS Server Setup Guide