Introduction to Services for NFS
NFS is the abbreviation for Network FileSystem, which was first developed by Sun, the company. Its biggest function is to be able to use the network, so that different machines, different operating systems, can share the individual files
Installing NFS Services
To see if the System has NFS installed
[Email protected] ~]# Rpm-qa | grep NFS
[Email protected] ~]# Rpm-qa | grep rpcbind
Installing NFS
[Email protected] ~]# yum-y install nfs-utils rpcbind
server-side configuration
Create a shared directory/data/lys on the NFS server and set permissions
[Email protected] ~]# mkdir-p/data/lys
[Email protected] ~]# ll/data/
[Email protected] ~]# chmod 666/data/lys/
Edit Export File
[Email protected] ~]# Vim/etc/exports
/data/lys client IP (rw,no_root_squash,no_all_squash,sync)
Configuration takes effect
[Email protected] lys]# Exportfs-r
start Rpcbind, NFS services
[[Email protected] lys]# service Rpcbind start
[[Email protected] lys]# Service NFS Start
to view the registration status of the RPC service
[Email protected] lys]# rpcinfo-p localhost
after your NFS server is set up, we can test the server to see if we can go online. is to use the Showmount command to check
[Email protected] lys]# showmount-e localhost
Client Configuration
Installing the Nfs-utils Client
[Email protected] ~]# yum-y install Nfs-utils
Create mount Directory
[Email protected] ~]# Mkdir/lys
View shared directory information thrown by the server
[[email protected] ~]# SHOWMOUNT-E server IP
to improve the stability of NFS, use TCP protocol mount, NFS default UDP protocol
[[email protected] ~]# mount-t NFS 192.168.2.203:/data/lys/lys-o proto=tcp-o nolock
Viewing Mount results
[Email protected] ~]# df-h
View Validation Results
Service Side
[Email protected] lys]# echo "Test" > Test.txt
Client
[Email protected] ~]# Cat/lys/test.txt
Test
[Email protected] ~]# echo "204" >>/lys/test.txt
Service Side
[Email protected] lys]# Cat/data/lys/test.txt
Test
204
Construction and configuration of NFS server under Linux