CentOS 6.x for NFS sharing

Source: Internet
Author: User

CentOS 6.x for NFS sharing

Network Environment:
One Linux server ip address 192.168.1.254 and one Linux client ip address 192.168.1.100
Operating System: CentOS 6.5
Requirement Description:
1: Share/root with 192.168.93.129, which can be written or synchronized. Allow the client to access the IP address with the root permission.
2: Share/var/www/html with the network segment 192.168.93.0/24, writable and asynchronous

Steps:
1: Check whether the nfs program is installed

[Root @ server ~] # Rpm-qa | grep nfs check nfs whether nfs-utils-1.2.3-39.el6.i686 is installed [root @ server ~] # Rpm-qa | grep rpcbind check whether RPC is installed with rpcbind-0.2.0-11.el6.i686

2: start the service and set it to boot

[root@server ~]# service nfs start[root@server ~]# service rpcbind start[root@server ~]# chkconfig rpcbind on[root@server ~]# chkconfig nfs on

3: Enable the corresponding port

iptables  -I INPUT -p tcp --dport 111 -j ACCEPTiptables  -I INPUT -p udp --dport 111 -j ACCEPTiptables  -I INPUT -p tcp --dport 2049 -j ACCEPTiptables  -I INPUT -p udp --dport 2049 -j ACCEPTiptables  -I INPUT -p tcp --dport 30001:30004 -j ACCEPTiptables  -I INPUT -p udp --dport 30001:30004 -j ACCEPTservice iptables saveservice iptables restart

4: Requirements 1 and 2 for editing the configuration file

[root@server ~]# vim /etc/exports/root 192.168.93.129(rw,sync,no_root_squash)/var/www/html 192.168.93.0/24(rw,async)

5. Restart the service.

[root@server ~]# service nfs restart[root@server ~]# service rpcbind restart

6. Set/var/www/html local write permission on the server.

[root@server ~]# chmod o+w /var/www/html

7. Client Test

[root@client ~]# mkdir -p /data/root[root@client ~]# mount 192.168.93.128:/root /data/root/[root@client ~]# mkdir -p /var/www/html_client[root@client ~]# mount 192.168.93.128:/var/www/html /var/www/html_client[root@client ~]# mount |tail -2

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.