Yum Install nfs-utils portmap- y
Portmap has been changed to Rpcbind in centos6.5
first start rpcbind/etc/init.d/rpcbind start/etc/init.d/nfs start
Mkdir/backup create a shared directory \
Make sure that nfsnobody are the same uid:65534, otherwise not a permission
grep nfsnobody/etc/passwd
Vim/etc/exports
/backup 192.168.1.1/24 (Rw,sync,all_squash, anonuid=65534,anongid=65534)
Restart/etc/init.d/nfs Reload
Then look at the Cat/var/lib/nfs/etab
Then view the Web server
SHOWMOUNT-E 192.168.1.29
Then mount (temporary Mount)
Mount-t NFS 192.168.1.29:/backup/mnt
Attach user-uploaded directories to backup on webserver (user uploaded files, put on storage)
Back up the files in the/data0/www/blog/wp-content/uploads directory first,
MV 2016/opt
Mount-t NFS 192.168.1.29:/backup/blog-uploads/data0/www/blog/wp-content/uploads
Note Permissions to modify folders
Rpcbind Set Boot start
Chkconfig--level NFS On
Chkconfig--level Rpcbind on
or in the/etc/rc.local.
/etc/init.d/rpcbind start
Start Automatic mount NFS File System
To write mount information to the Fstab file
Vi/etc/fstab
192.168.1.29:/backup//mnt/public NFS Defaults
Save exit
Mount-a
Mount | grep NFS View Mount condition
Umount-f/data0/www/blog/wp-content/uploads
Error
Using the Fuser command, first confirm that there are processes that need to be killed
Fuser-cu/data0/www/blog/wp-content/uploads
/mnt:15060c (Root)
Second, send a sigkill signal to the process
Fuser-ck/data0/www/blog/wp-content/uploads
/mnt:15060c
Confirm
Fuser-c/data0/www/blog/wp-content/uploads
Fuser: Use a file or a section word to represent the recognition process. I used his two features: view the process I need and I'm going to kill the process I've found.
For example, when you want to umount the optical drive, the result system prompts you to use the device or busy, but you can not find out who used him. Fuser can come in handy at this time.
Precautions
1, the NFS server shuts down to ensure that NFS does not have a client connection, otherwise it will not shut down properly. You can force the NFS service to stop or kill first.
Boot up Apache, NFS
Two methods:1. Add execution command line in /etc/rc.local
2. Add a script under the/etc/init.d/ directory
1. Add execution command line in /etc/rc.local
/application/bin/apachectl start
/application/sersync/sersync2-d-r-o/application/sersync/confxml.xml
2. Add a script under the/etc/init.d/ directory
The Apachectl file in the Apache/bin directory is actually a startup script, copy the Apachectl file to the/etc/init.d/directory, and rename it to Apache (the name is easy to remember.)
# Cp/application/apache/bin/apachectl/etc/init.d/apache2
Then modify the Apache file to allow it to support service and Chkconfig commands:
# Vim/etc/init.d/apache
Add the following 2 lines to any place in the previous comment "#":
# chkconfig:35 20 80
# Description:apache
Description
- The meaning of the 3 numbers is: at which RunLevel, start Apache (3,5), start sequence (S20), and close the ordinal (K80).
- 3 and 5 means that Apache is started by default at the third boot level and the fifth boot level
- 20 refers to the system up when there are a lot of services need to start, and this program is ranked in the 20th bit start, and so on
- 80 means that when the system shuts down, the order of service is closed in 80th place.
Attention:
After saving, you can start and close Apache with service.
Like what:
# service Apache Start
# NETSTAT-ANTP |grep 80
TCP 0 0::: +:::* LISTEN 13410/httpd
Apache follows the system to boot (boot from boot) and needs to add apache2 to the Chkconfig to:
# Chkconfig–-add Apache2
# Chkconfig Apache2 on
Lamp Cluster Project Five deployment of NFS storage services and setting up Web service mounts