Linux server -NFS

NFS server deployment process:
the first mileage: Check Services software is installed
rpm -qa | egrep "rpcbind | nfs -utils"
Second mileage: Services software is installed
yum install -y nfs-utils rpcbind

Supplement: nfs-utils rpcbind and two software spree
RPM -ql nfs-utils
/etc/rc.d/init.d/nfs <- nfs service startup script file
/ usr / sbin / showmount <- check nfs information shared directory service

-ql the rpcbind RPM
/etc/rc.d/init.d/rpcbind <- the rpcbind service startup script file
/ usr / sbin / rpcbind <- check rpc nfs service to service registration information

Third mileage: Write nfs service configuration file
[root @ nfs01 ~] # LL / etc / Exports
-rw-r - r-- 1 root root 30 2018-02-25 13:30 / etc / Exports <- nfs service configuration file, the default already exists
[root @ nfs01 ~] # vim / etc / Exports
/ the Data 172.16.1.0/24(rw,sync)
Description: The configuration file specifies the information specified shared directory shared directory access control network or host information (shared directory parameter information)

Fourth mileage: Create nfs shared directory service, and to authorize
mkdir / the Data
chown -R nfsnobody.nfsnobody / the Data

Fifth mileage: nfs start and rpc service
/etc/init.d/rpcbind start <- First Start rpcbind service
/etc/init.d/nfs start <- Next start nfs service

The sixth Mileage: service configuration checks carried out
to check the availability of information is registered
rpcinfo -p 172.16.1.31
check for available shared directory
[root @ nfs01 ~] # showmount -e 10.0.0.31
Export List for 10.0.0.31:
/ data 172.16.1.0/24

NFS client deployment process:

The first mileage: Check Services software is installed
rpm -qa | egrep "rpcbind | nfs -utils"
Second mileage: Services software is installed
yum install -y nfs-utils rpcbind

Third mileage: mount the shared directory
[root @ web02 ~] # 172.16.1.31:/data Mount -t nfs / mnt
[root @ web02 ~] # df -h
Filesystem Size Used Avail the Use% Mounted ON
172.16.1.31 : / data 8.6G 1.9G 6.4G 23% / mnt

Fourth mileage: shared memory test
[root @ web01 mnt] # test.txt Touch
[root @ web01 mnt] # LS
test.txt

[root@nfs01 ~]# cd /data/
[root@nfs01 data]# ls
test.txt

[root @ web02 ~] # LS / mnt
test.txt
Description: web01 data created in the mnt directory, you can see on the nfs server and web02 that has been stored in data sharing

Guess you like

Origin www.cnblogs.com/lj7xun/p/11003735.html