Install and configure the NFS server in Ubuntu 14.04
(1) install the NFS server
1.1-install the Ubuntu nfs server:
Sudo apt-get install nfs-kernel-server
1.2-install the nfs client:
Sudo apt-get install nfs-common
(Nfs-commom is also installed when nsf-kernel-server is installed. If this software package is not installed, execute the command in 1.2)
1.3-set the shared file directory
Sudo mkdir /***/***
(2) Configure NFS
2.1-modify the configuration file/etc/exports
Add/home/USER/nfs * (rw, sync, no_root_squash, no_subtree_check) to the last line)
The preceding directory is shared with the nfs service client. * indicates that all network segments can be accessed (or specific IP addresses can be used)
Rw: The Client Connected to this directory has read and write permissions on the shared directory.
Sync: synchronous data writing memory and Hard Disk
No_root_squash: when the user accesses the shared folder with the root user, the root user is not mapped. (Root_squash: the root user is mapped to an anonymous user when the root user accesses the shared folder)
No_subtree_check: the permission of the parent directory is not checked.
2.2-nfs is an RPC program. before using it, you need to map the port and set it through rpcbind:
Sudo service rpcbind restart
2.3-restart the nfs service:
Sudo service restartnfs-kernel-server restart
2.4-test
Run the following command to display the shared directory:
Showmount-e
(3) attaching commands
To execute the mount command on any server, you can mount the shared path on the specified ip server to the local.
Sudo mount-t nfs ***. ***:/home/USER/nfs-client/
* **. ** Is the IP address of the NFS server.
If you want to enable automatic mounting:
Run the above command sudo mount-t nfs ***. ***. ***. * **:/home/USER/nfs-clinet/write to/etc/rc. local file.
(4) Others
Client error:
Mount: file system type error, option error, ***. ***:/home/USER/nfs has bad super block,
The code page, Helper Program, or other errors are missing
(For some file systems (such as nfs and cifs), you may need
One/sbin/mount. <type> Helper Program)
Some useful information can be found in syslog in some cases-Please try
Dmesg | tail command.
Solution:
Sudo apt-get install nfs-common
-------------------------------------- Split line --------------------------------------
Install NFS server in Ubuntu 12.04
Install and configure the NFS server to share the Ubuntu 12.04 and ARM files.
Build an nfs server in Ubuntu
File Server NFS configuration details
Build an NFS Network File System server in Ubuntu
Heartbeat_ldirector + LB + NFS for HA, LB, and file sharing
How to Configure NFS server in CentOS 5.5
Install and use NFS in Ubuntu 12.10
-------------------------------------- Split line --------------------------------------