Linux-NFS Service

Note: The following experimental environment are Centos7.3! ! !

 

The figure below shows NFS Service Works:

NOTE: You must open rpc service, and then turn the nfs service

lab environment:

An operating system for the server Centos7.3's (IP: 192.168.10.105)

An operating system Centos7.3 clients (IP: 192.168.10.106)

Lab topology :( This example uses only one client presentation)

Experimental Procedure:

1. Install nfs-utils-1.3.0-0.33.el7.x86_64 and rpcbind-0.2.0-38.el7.x86_64 two packages, wherein rpcbind default package already installed, simply install nfs-utils line

yum install nsf-utils -y

2. Set rpc services and nfs service at startup.

systemctl start nfs service nfs start

systemclt enable nfs nfs service is set to boot from the start

systemctl start rpcbind start rpc service

systemctl enable rpcbind rpc service is set to boot from the start

3. Modify the configuration file nfs service:

vim /etc/exports

format:

Local directory server allows clients to access the server IP (usually segments) (permission mode) Note: Use a comma between modes and permissions

In this case:

mkdir / nfs create a directory called test of nfs

echo "/nfs 192.168.10.0/24(rw,sync)"  >> /etc/exports

Where: 192.168.10.0/24: nfs server to allow access to the client addresses

    RW: means permission to write ( Note: if only permissions set here is not enough, but also need to set the permissions of the shared directory, such as: the directory / nfs of

Is a group and the group are set to the genus nfsnobody, command: chown nfsnobody is: nfsnobody is / NFS )

    sync: Real-time data is written to memory is written to disk 

Reload the configuration file: systemctl reload nfs

4. Client Test:

showmount -e 192.168.10.105 view has been shared directory server

mount -t nfs 192.168.10.105:/nfs / opt nfs 192.168.10.105 mount directory to the client at the local opt directory

Create a test.txt file on the server, the client can view:

Server:

Client:

 

 

Guess you like

Origin www.cnblogs.com/Vampire-MIn/p/11904529.html