linux service of NFS Service article

First, the concept

NFS ( Network File Server ) Network File System (map). Network File System is FreeBSD One of the supported file system, also known as NFS ;  NFS allows a system to share directories and files with others on the network.

Role: Linux for file sharing between systems

Advantages: simple to configure, easy to use

Disadvantages: poor compatibility, security is low

Application: inside the room shared cluster server

Mode: C / S Mode

Port: NFS usually runs on 2049 port

Second, the deployment of NFS

note:

1 , due to the use of NFS prior service for file sharing, require the use of RPC ( Remote Procedure Call , Remote Procedure Call) service NFS server's IP to send information to the client address and port number. So, start nfs before, you need to query rpcbind state, if the service is stopped, you need to enable rpcbind , then enable nfs ;

2 , a graphical interface will own NFS , so no need to perform a first step, is minimized installed, the client and server need to be installed;

3 , in the mount step, needs to be performed on the client;

4 , when setting mount directory, you need to pay attention to the absolute path, and whether to allow access to the directory;

5 , when you set permissions on a shared directory, in addition to the service authority, but also pay attention to system privileges.

Build steps:

1 , download and install

# yum install nfs-utils -y

2 , start

# Systemctl Start nfs # After opening inquiries about the best state: systemctl Status nfs

3 , Configuration

# vim /etc/exports

/PATH HOSTNAMErw/ro

Shared address client's IP   sharing permissions

/ ken 172.20.10.7 (rw) # to specific ip share, rw means permission

/ data * (rw) # to all ip share   

/ data 172.20.10.0/28(rw) # to share out the segment 28 indicating the mask 

/ data 172.20.10.0/28(rw) 192.168.64.0/24(rw) # plurality of networks

Note: * represents all segments open permissions

nfs can also share multiple directories

/ Ken 192.168.64.5 (rw)

/test 192.168.64.7(rw)

4 , refresh

# exportfs -r

Change owner: #chown -R & lt nfsnobody is: nfsnobody is / Home / renyz

Or change the permissions: #chmod 757 / Home / renyz

5 , the client mount use (the client need to download nfs-utils )

# mount -t nfs ServerIP:/PATH /LocalIDIR

# Mount kiosk IP : / shared directory / local directory

# Showmount -e ServerIP # view shared

6 , boot automatically mount

Service machine IP : / shared directory / local directory nfs default 0 0 / etc / fstab

Three, the autofs (client operations)

nfs service long connection of (client mount after the completion of the connection remains between the client and the server, regardless of whether the data transmission)

Advantages: fast response; disadvantages: a waste of resources

The service automatically mount unmounted ( 15 automatic solution linked minutes)

1 , the installation

# yum install autofs -y

2 , the main configuration file with

# vim /etc/auto.master

/misc   /etc/auto.misc

# Client mount point directory /etc/auto.misc

# Trap        rule file

# Path into the left side of the implementation of the rules on the right

3 , configuration rules file

# vim /etc/auto.misc

Trigger point execution rules (command)

cd  -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

1   -fstype=nfs,rw  192.168.11.3:/renyz/1

2   -fstype=nfs,rw  192.168.11.3:/renyz/2

4 , restart the autofs service

# systemctl restart autofs

5 , test

Four, SSH

SSH is the Secure Shell abbreviation, by the IETF developed a networking group. SSH is a secure protocol at the application layer basis. SSH is more reliable, providing security protocol for remote login session, and other network services.

Use the format: SSH USERNAME @ HOSTNAME

Note: where USERNAME is the user name of the server, HOSTNAME is the access address of the server.

Guess you like

Origin www.cnblogs.com/renyz/p/11226800.html
Recommended