1. NFS has been installed on the server in full installation, if not installed, you need to install it with the following command
Yum-y Install Nfs-utils Rpcbind
2. Create the NFS directory you want to use
Mkdir-p/nfs/k8s
3. Modify the Service configuration directory for NFS
vim/etc/Exports Add content /nfs/k8s * (Rw,insecure,sync,no_subtree_check,no_root_squash)
The meaning of this code copy from other people's Blog park
common parameters are: parameter value content description rw ro The directory share permissions are erasable (read-write) or read-only (read-only), but ultimately can not read or write, or rwx and identity of the file system. Sync Async sync means that data is written synchronously to the memory and hard disk, andasync means that the data is staged in memory, not directly to the hard disk! No_root_squash root_squash Client uses NFS file system when the account is root, how can the system determine the identity of this account? By default, the identity of the client root is compressed into nfsnobody by the Root_squash setting, so the system for the server will be more secure. But if you want to open the client to use root to operate the server's filesystem, then you need to open No_root_squash! All_squash regardless of who is logged in to NFS, his identity will be compressed into anonymous users, usually nobody (nfsnobody)! Anonuid anongid *_squash refers to the UID setting value of the anonymous user, usually nobody (nfsnobody), but you can set the value of this UID yourself! Of course, this UID must exist in your/etc/passwd! Anonuid refers to the UID and Anongid is the group GID.
4. Restart NFS-related services
First make the previously modified document effective
Command
Exportfs-r
Systemctl Restart NFS systemctl Restart Rpcbindsystemctl enable Nfssystemctl enable Rpcbind
5. Add roles and features to Windows
Run-as input control-> open programs with features-open enable live shutdown Windows features
To add related features
6. Working with the command line
10.24. 103.1 10.24. 103.1:/nfs/k8s z: #mount挂在该目录 to Z disk to open Z disk for viewing
Uninstall the Directory
Umount Z:
Can
Simple use of NFS under CentOS and NFS storage methods for Windows off Linux