NFS file system experiment

Services for NFS network file system, suitable for internal corporate share (rpcinfo -p port view NFS, NFS random port too, is not conducive to the firewall policy creation)
NFS: Network File System network file system, kernel-based file system. Sun has developed, by using NFS, users and programs can access files on remote systems such as access to local files (Remote Procedure Call Protocol remote call procedure) based RPC implementation
RPC using C / S mode, the client program requests the calling process send a message calling process parameters to the service process, and then waits for a reply message. On the server side, maintain sleep until the process reaches the call information. When a call message arrives, the server to get the process parameters, calculated results, send a reply message, and then wait for the next call information, and finally, the client calls the process receives a reply message, get the process results, and then call the execution to proceed
NFS advantages: saving local store space, the common data, such as the home directory is stored on the NFS server and can be accessed via a network, the local terminal may be used by itself to reduce the storage space

Server
format / etc / exports define a shared resource
Vim / etc / exports
/ Data / NFS1 (RW) shows all ip, can specify different ip, Example: / data / test 192.168.0.1 (ro ) 192.168.0.2 ( RW) * (RO)
exprotfs -v -R & lt overloaded profile view profile details
service nfs start
NFS file system experiment
client
showmount -e 192.168.36.7 view corresponding to the configuration of the host
mount 192.168.36.7:/data/nfs1 / mnt mount to use the local
authority refused to mount the file permissions ntf press service root_squash root privileges, the unit created in as root for nfsnobody, the documents have permission to modify a pair nfsnobody, just press root, no compression is id non-users
NFS file system experiment
found to successfully mount, but can not successfully create the file because permissions after refusing to mount, root_squash press root user permissions, file permissions ntf service the machine created in as root for nfsnobody, to modify the file has paired nfsnobody permissions can only squeeze root, not the non-compressed user id, chown nfsnobody: nfsnobody / data / nfs1
NFS file system experiment
successfully created, and the owner is a group nfsnobody
NFS file system experiment
can also be mounted through / etc / exports election Item added no_root_squash manipulation root privileges do not press
NFS file system experiment
the test is successful, without having to remount
NFS file system experiment

Testing multiple hosts to share the home directory
server configuration 192.168.0.10
[root @ centos6 ~ 18:38:24] #mkdir / Home / the Test
[root @ centos6 ~ 18:38:47] #cp -r / etc / skel /. / Home / Test
[centos6 the root @ ~ 18:39:04] -la #ls / Home / Test
Total 12 is
-rw-R & lt - r-- the root 18 is the root. 1 On May 10 18:39 .bash_logout
-rw-R- On May 176 the root. 1 the root -r-- 10 18:39 .bash_profile
-rw-R & lt - r--. 1 the root On May 10 18:39 .bashrc the root 124
[centos6 the root @ ~ 18:39:33] -R & lt #exportfs
[centos6 the root @ ~ 18:40:02] -R & lt #chown test: test / Home / test
[centos6 the root @ ~ 18:41:50] #chown test: test / Home / test
NFS file system experiment
client test 192.168.0.10
[the root centos6 mnt 19:10:29 @] #mount 192.168.0.10:/home/test / Home / Test
[Test @ centos6 ~ 19:14:03] $ DF
DF: `/ mnt ': File handle the Stale
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 20027260 1939848 17063412 11% /
tmpfs 431876 0 431876 0% /dev/shm
/dev/sda1 194241 33997 150004 19% /boot
/dev/sda3 10190136 23028 9642820 1% /data
192.168.0.10:/home/test
20027264 1939584 17063680 11% /home/test
[test@centos6 ~ 19:14:05]$touch 123
[test@centos6 ~ 19:14:09]$ls -l
total 0
-rw-rw-r-- 1 test test 0 May 10 18:43 123

Guess you like

Origin blog.51cto.com/14233913/2403960