Let's summarize the construction of NFS server

Service that realizes NFS

Service name server client Explanation
portmap TCP RPC program number/Convert to IP port number
nfsd File system export and client request processing
mountd Remote file system mount and unmount

portmap##

/etc/rpc


portmapper	100000	portmap sunrpc rpcbind
rstatd		100001	rstat rup perfmeter rstat_svc
rusersd		100002	rusers
nfs		100003	nfsprog
ypserv		100004	ypprog
mountd		100005	mount showmount

--TCP/UDP port numbers are dynamically assigned. --In other words, in order for the RPC client to use it, it is first necessary to know the port number. --portmap returns the port number of the corresponding service when inquired by the RPC client. --A program that provides services using RPC registers its information in portmap at startup.

--You can check the connection status of the RPC service with ** rpcinfo **.

rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper

NFS server settings

To start the service:

systemctl start rpcbind
systemctl start nfs-server
systemctl start nfs-lock

Publishing a specific directory on the NFS server side is called ** export **. The export directory is described in **/etc/exports **.

/etc/exports


/share 192.168.1.0/255.2255.255.0(rw)
/pub   *.example.com(ro)
/etc/exports options Explanation
ro Read-only
rw Read / write
no_root_squash Execute with root privileges when accessing as root
root_squash Execute with anonymous account privileges when accessing as root
all_squash Perform all access with anonymous account privileges

Use ** exports ** to view the export status and reflect changes in/etc/exports.

exports options Explanation
-a Export all directories/Unexport
-r Re-export all directories
-u Unexport
-v Detail View

Use ** showmount ** to find out which directories you are exporting.

showmount options Explanation
-a Show client host name and mounted directory
-e Show directories exported on the specified host

Use ** nfsstat ** to look up NFS statistics.

nfsstat options Explanation
-s Show only NFS server statistics
-c View only NFS client-side statistics
-n Show NFS statistics only
-r Show RFC statistics only
-o net View network layer statistics

NFS client settings

--Use ** mount ** to mount the remote file system using NFS. --Specify nfs for the file type system. --Prepare a directory to be a mount point on the local file system.

mount -t nfs linux:/pib /mnt/nfs
NFS-specific mount options Explanation
bg Try in the background even if the mount fails
fg Run in the foreground
soft Soft mount
hard Hard mount
intr Allow interrupts at heart mount
retrans Number of retries for soft mount
nolock Do not lock files
rsize= Read block size
wsize= Write block size

You can put it in/etc/fstab so that the remote file system can be mounted automatically when the system boots.

linux:/pib /mnt/nfs nfs defaults 0 0 

Link#

AWS has EFS, so it seems unnecessary, but the article below was well organized. Build NFS server/client on EC2 ✳️ NFSv4 or later, no portmap, rpcbind, nfslock required

Recommended Posts

Let's summarize the construction of NFS server
The story of remounting the application server
Let's decide the winner of bingo
I tried the asynchronous server of Django 3.0
Let's summarize the Python coding standard PEP8 (1)
Let's investigate the mechanism of Kaiji's cee-loline
Change the destination batfish server of pybatfish
Regularly monitor the HTTP response of the web server
Let's summarize Squid
Let's summarize Apache
Let's summarize various implementation codes of GCN by compounds
I tried to summarize the basic form of GPLVM
Let's use the API of the official statistics counter (e-Stat)
Let's clear the ambiguity of the hyphen (-) of the su command now! !!
Let's break down the basics of TensorFlow Python code
Summarize the knowledge of reading Go's HTTP implementation ~ Slice ~
Let's use the Python version of the Confluence API module.
Summarize the knowledge of reading Go's HTTP implementation ~ Channel ~
Visualization of the connection between malware and the callback server
Let's use the open data of "Mamebus" in Python
[Ev3dev] Let's understand the mechanism of LCD (screen) control
Let's analyze the emotions of Tweet using Chainer (2nd)
Let's analyze the sentiment of Tweet using Chainer (1st)
[Python] Let's change the URL of the Django administrator site
I tried to summarize the string operations of Python
The beginning of cif2cell
the zen of Python
Web server construction commentary
The story of sys.path.append ()
Ubuntu (18.04.3) Web server construction
Revenge of the Types: Revenge of types
Let's cross the wall of the left-handed coordinate system and the right-handed coordinate system.
Let's decide the lecture of PyCon JP 2016 by combinatorial optimization
Let's visualize the trading volume of TSE stocks --jpxlab sample
Let's utilize the railway data of national land numerical information
Let's decide the position of the fire station by combinatorial optimization
Let's make the analysis of the Titanic sinking data like that
Let's execute the command on time with the bot of discord
Check the memory status of the server with the Linux free command
Let's touch the API of Netatmo Weather Station with Python. #Python #Netatmo
Let's predict the timing of the bals and enjoy the movie slowly
Check the operating status of the server with the Linux top command
Let's guess the development status of the city from the satellite image.
I found the cause of mysterious communication of Minecraft server (Spigot)
Let's visualize the number of people infected with coronavirus with matplotlib
[Machine learning] I tried to summarize the theory of Adaboost
Let's use the distributed expression of words quickly with fastText!
Install the latest version of Git on your Linux server
The highlight of REST + Normal Site construction with Flask, Eve
Let's reduce the man-hours required for server setup with Ansible
Let's summarize the basic functions of TensorFlow by creating a neural network that learns XOR gates