NFS: Is the network file system.
Main function: Through the network (LAN) allows different host systems to share files or directories.
Main Purpose: NFS Network File system is generally used to store shared video, pictures, attachments and other static resource files.
About Port Usage Instructions:
1. The data is transferred over the network, so some ports are used to transfer it.
2.NFS the port that is used when transmitting data is randomly selected.
Implemented through RPC (remote Procedure Call) Protocol/service.
How RPC works:
1. Start the RPC service
2.nfs randomly takes several ports at startup and proactively registers with the RPC service for access to relevant information
3. Client requests NFS service to RPC
4.RPC return port to client
5. Take the address and port to request the transfer of data to the NFS server
So in summary: The NFS service must start after the RPC service starts, and the client does not need to start the NFS service, but it needs to start the RPC service.
NFS Installation is simple:
1.yum Installation
Yum Install-y
2. Create a shared directory:
Mkdir/sharestore
3. NFS Shared file path configuration:
Edit/etc/exports Add the following line, and then save to exit.
vi/etc//share * (Rw,sync,no_root_squash)
4. Start NFS and set up the NFS service to boot from:
Service Rpcbind startservice NFS startchkconfig NFS Onchkconfig rpcbind on
5. Windows mount
Open the Windows Server DOS Run window (not PowerShell), and then type:
Servermanagercmd.exe-install fs-nfs-services
To ensure that the disk mapping still exists after the system restart, run the following command:
NET Use/persistent:yes #这一命令是让磁盘映射永久存在
Mount, Z is mounted after the drive letter
Mount Ip:/share-o nolock,rsize=1024,wsize=1024,timeo=15 z:
NFS Related parameters
Rw:read-write, writable permission;
Ro:read-only, read-only permission;
Sync: Data synchronously written to memory and hard disk;
Async: Data is stored in memory rather than directly to the hard disk;
No_root_squash: Login to the NFS host using the share directory of the user, if it is root, then for this shared directory, he has root privileges! This project is "extremely unsafe" and is not recommended for use!
Root_squash: When the user who is logged in to the NFS host using the shared directory is root, then the user's permissions will be compressed into an anonymous user, usually his UID and GID will become nobody (Nfsnobody) the identity of the system account
All_squash: Regardless of who is logged in as the user of NFS, his identity will be compressed into an anonymous user
Mount Related parameters
-o nolock disables file locks and is not possible to mount on some of the basic systems of QEMU emulation
Rsize,wsize data block Size transferred (bytes)
Hard rigid mount, default setting. If communication with the server fails, the operation that attempts to access it is blocked until the server recovers.
Soft soft mounted. If the server communication fails, the operation that attempts to access it fails, returning an error message. This feature is useful for avoiding process "hangs" on trivial installation operations.
Timeo=n sets the time-out period in one-tenth seconds for the request.
To view shared directories: Showmount-e IP
View shared directory connections: Showmount-a IP
Windows Server Mounts NFS shares