In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to install and configure NFS services under CentOS6.9. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Server environment: CentOS6.9 Linux 2.6.32-696.el6.x86_64
Install the NFS service
Both the nfs client and the server only need to install the nfs-utils package, and the rpcbind service is installed in conjunction with the yum installation.
# yum-y install nfs-utils
Boot up
# chkconfig rpcbind on# chkconfig nfs on
For the needs of operation and maintenance management, you can quickly find relevant startup services, configure chkconfig, and append boot startup scripts at the same time.
# tail-2 / etc/rc.local/etc/init.d/rpcbind start / etc/init.d/nfs start
Configure Port
In addition to the main program port 2049 and the port 111of rpcbind are fixed, nfs also uses some random ports, which will be defined in the following configuration to configure the firewall
# vim / etc/sysconfig/nfs# append port configuration MOUNT_PORT=4001 STATD_PORT=4002LOCKD_TCPPORT=4003LOCKD_UDPPORT=4004RQUOTAD_PORT=4005
Configure directories to be shared
# mkdir-p / var/nfs/simple-nfs # directories to be shared # vim / etc/exports # configure access rights / var/nfs/simple-nfs 192.168.100.0and24 (rw,async,root_squash)
Access permissions:
Rw:read-write is readable and writable. Note that only if the client is set to read and write, it cannot write normally, and the permissions of the shared directory should be set correctly. Refer to question 7.
Ro:read-only, read-only
Sync: files are written to both hard disk and memory
Async: files are temporarily stored in memory instead of being written directly to memory
If the no_root_squash:NFS client connects to the server using root, it also has root permission for the directory shared by the server. It is obviously not safe to turn this on.
If the root_squash:NFS client connects to the server using root, then the directory shared by the server has anonymous user rights, and usually he will use nobody or nfsnobody identity
All_squash: no matter what user the NFS client uses to connect to the server, it has anonymous user permission for the directory shared by the server.
Anonuid: the UID value of an anonymous user, usually nobody or nfsnobody, which can be set here
Anongid: the GID value of anonymous users.
Configure the firewall
# vim / etc/sysconfig/iptables-An INPUT-p tcp-m tcp-- dport 111j ACCEPT-An INPUT-p udp-m udp-- dport 111j ACCEPT-An INPUT-p tcp-m tcp-- dport 2049-j ACCEPT-An INPUT-p udp-m udp-- dport 2049-j ACCEPT-An INPUT-p tcp-m tcp-- dport 4001RV 4005-j ACCEPT-An INPUT-p udp-m udp-dport 4001RV 4005-j ACCEPT
Restart services and firewalls
# service nfs restart# service iptables restart# or reload
Linux client mount
# mount-t nfs 192.168.100.110:/var/nfs/simple-nfs / mnt
You can also write the mount configuration to the fstab file. Just like ordinary disk mount, you can also specify permissions during mount, except that the type is nfs.
Thank you for reading! This is the end of the article on "how to install and configure NFS services under CentOS6.9". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.