Linux environment deployment record (2): linux environment deployment record

Source: Internet
Author: User

Linux environment deployment record (2): linux environment deployment record

NFS file sharing service

Assume that the existing two Server IP addresses are 192.168.0.2 and 192.168.0.3, 192.168.0.2 as the Server, and 192.168.0.3 as the Client, then:

Nfs-utils rpcbind must be installed on both machines:

yum -y install nfs-utils rpcbindchkconfig nfs onchkconfig rpcbind on

Enable Firewall ports 111 and 2049:

/sbin/iptables -I INPUT -p tcp --dport 111 -j ACCEPT/sbin/iptables -I INPUT -p udp --dport 111 -j ACCEPT/sbin/iptables -I INPUT -p tcp --dport 2049 -j ACCEPT/sbin/iptables -I INPUT -p udp --dport 2049 -j ACCEPT/etc/init.d/iptables saveservice iptables restart

Next, create a shared directory on 192.168.0.2:

mkdir -p /home/nfs

Modify the nfs configuration file:

vi /etc/exports

Add the following code:

/home/nfs 192.168.0.0/24(rw,sync,insecure,no_root_squash)

Start the nfs and rpc services:

service rpcbind startservice nfs start

View the nfs shared directory released on the local machine:

showmount -e  localhost

As the client 192.168.0.3, you can directly mount the Server Directory to the local directory after starting the service:

mkdir -p /home/nfs_servermount 192.168.0.2:/home/nfs /home/nfs_server

View the mounting status of the file system:

tail -1 /etc/mtab

Set automatic mounting:

vi /etc/fstab
# Add the following code 192.168.0.2:/home/nfs/home/nfs_server nfs ults, rw, _ netdev 0 0

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.