Configure the nfs service for the shared disk in linux
Source: Internet
Author: User
Assume that the shared disk server 192.168.1.100 and the directory/opt/resource/only allow access from the 192.168.1. * network segment. Modify the/etc/exports file and add:/opt/resource192.168.1. * (rw, async, no_root_squash). execute: exportfs-a modify/etc/sysconfig /.. assume that the shared disk server 192.168.1.100, directory/opt/resource/, only 192.168.1 is allowed. * network segment access.
Modify the/etc/exports file and add:/opt/resource 192.168.1. * (rw, async, no_root_squash)
Run: exportfs-
Modify the/etc/sysconfig/nfs file and remove the following comments:
RQUOTAD_PORT = 875
LOCKD_TCPPORT = 32803
LOCKD_UDPPORT = 32769
MOUNTD_PORT = 892
Restart the nfs service: service nfs restart
Firewall configuration added:
# Portmap
-A input-p tcp -- dport 111-j ACCEPT
-A input-p udp -- dport 111-j ACCEPT
# Nfsd
-A input-p tcp -- dport 2049-j ACCEPT
-A input-p udp -- dport 2049-j ACCEPT
# Rquotad
-A input-p tcp -- dport 875-j ACCEPT
-A input-p udp -- dport 875-j ACCEPT
# Mountd
-A input-p tcp -- dport 892-j ACCEPT
-A input-p udp -- dport 892-j ACCEPT
# Lockd
-A input-p tcp -- dport 32803-j ACCEPT
-A input-p udp -- dport 32769-j ACCEPT
Assume that the ing server 192.168.1.200 needs to be mounted, and the directory path is/opt/web/resource/
Mount: mount-t nfs 192.168.1.100:/opt/resource/opt/web/resource
To automatically mount a server, modify the/etc/fstab file and add the following content:
192.168.1.100:/opt/resource/opt/web/resource nfs defaults 0 0
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service