The Experiment centos6.5
192.168.204.150 nfs150
192.168.204.128 Client
Experiment starts, still shuts down the firewall, turns off SELinux
Do you remember the order?
#/etc/init.d/iptables Stop
# chkconfig Iptables off
# Vim/etc/selinux/config
Modify to Selinux=disabled
# Setenforce 0 Immediate effect
The NFS (Network File system), which is one of the file systems supported by FreeBSD, allows computers in the network to share resources across TCP/IP networks. In an NFS application, a local NFS client application can transparently read and write to files located on the remote NFS server, just as you would access a local file.
"NFS 150" server-side NFS
Yum Install nfs*-y
# Mkdir/webdata
NFS installation complete, need to create a shared directory, shared directory in the/etc/exports file configuration
/webdata/* (Rw,sync,no_root_squash)
parameter of the note at the tail, thank you
And then we can start NFS.
#/etc/init.d/rpcbind Start # Please start Rpcbind or you'll get an error.
# Chkconfig Rpcbind on
#/etc/init.d/nfs Start
# Chkconfig NFS On
Client
Can create a new folder
# Mkdir/webdata
And then execute
# mount-t NFS 192.168.204.150:/webdata/webdata
Congratulations, no success!
Now you need a new installation package
# yum Install Nfs-utils-y
Oh, depends on the package is really a lot, all installed
You can perform
# showmount-e 192.168.204.150 # View 150 What is the shared directory of the machine?
Execute again
# mount-t NFS 192.168.204.150:/webdata/webdata
# Cd/webdata
# ls
Yes, just like your local hard drive, as long as you have permission, you can do whatever you want.
Important, if you want to restart the machine every time, automatically mount, please modify the/etc/rc.local file, add mount command
Mount-t NFS 192.168.204.150:/webdata/webdata
Instead of not modifying/etc/fstab
Configuration file parameter explanation:
/webdata shared Directory
* On behalf of all IP can be accessed
RO: The host has read-only access to the shared directory
RW: This host has read and write access to the shared directory
Root_squash: When the client accesses the shared folder with the root user, the root user is mapped to an anonymous user
No_root_squash: When the client accesses the shared folder with root, the root user is not mapped
All_squash: Mapped to anonymous user when any user on the client accesses the shared directory
Anonuid: A user who maps a user on a client computer to a specified local user ID
Anongid: Maps the user on the client computer to the specified local user group ID
Sync: Data synchronously written to memory and hard disk
Async: Data is staged in memory, not directly to the hard disk
As long as the direction of the progress of every day, will always reach the distance you want!!!
Linux File Share NFS