CentOS6.6 shared file mounting between servers

Source: Internet
Author: User
Tags network function centos server
LinuxCentos (6.6) server file sharing and mounting purpose: Because server load balancer is set, file uploading on multiple servers must be synchronized. here, server 1 is set as the main file server 1: 192.168.1.100 Server 2: 192.168.1.20. install basic kit [per server] 1.nfs[ html] v

File sharing and mounting between linux Centos (6.6) servers

Purpose: Because server load balancer is configured on the server, file uploading on multiple servers must be synchronized. The purpose is to set server 1 as the master file server.

Server 1: 192.168.1.100

Server 2: 192.168.1.20

The wind is coming. stay Fox

Install basic kit [per server] 1.nfs [Html]View plaincopyprint?
  1. Yum install nfs-utils

 

2. set Service auto-start [Plain]View plaincopyprint?
  1. Chkconfig rpcbind on
  2. Chkconfig nfs on
3. start the service [Plain]View plaincopyprint?
  1. Service rpcbind start
  2. Service nfs start
Centos server 1 settings [Plain]View plaincopyprint?
  1. /Www/wwwroot/www.lanmps.com/uploads 192.168.1.20 (rw, no_root_squash, no_all_squash, sync)

Then reload [Plain]View plaincopyprint?
  1. Exportfs-r
View Share List [Plain]View plaincopyprint?
  1. Exportfs
Centos Server 2 settings 1. check if server 1 is shared [Plain]View plaincopyprint?
  1. Showmount-e 192.168.1.100
If shared, the shared list is displayed. 2. directory settings

The two server directories are the same, so you do not need to set them.

If it is different or not, create mkdir-p/www/wwwroot/www.lanmps.com/uploads

3. Mount [Plain]View plaincopyprint?
  1. Mount-t nfs-o rw 192.168.1.100:/www/wwwroot/www.lanmps.com/uploads
4. check whether the disk is mounted.

Method 1:

[Plain]View plaincopyprint?
  1. Df-h
Method 2:

Directly go to the/www/wwwroot/www.lanmps.com/uploads directory and check whether the file can be modified.
 

5. uninstall and delete sharing [Plain]View plaincopyprint?
  1. Umount/www/wwwroot/www.lanmps.com/uploads
6. set boot mounting and automatic loading Method 1 (recommended): Edit the/etc/rc. local file and add [Html]View plaincopyprint?
  1. Mount-t nfs-o rw 192.168.1.100:/www/wwwroot/www.lanmps.com/uploads
Method 2: edit/etc/fstab to find that this item is not successful and the network function is loaded at the end. Therefore, we recommend that you Method 1

 

[Html]View plaincopyprint?
  1. 192.168.1.100:/www/wwwroot/www.lanmps.cn/uploads nfs ULTS ults, soft, intr 0 0
Note: 192.168.1.100:/www/wwwroot/www.lanmps.cn/uploads this is a shared directory
/Www/wwwroot/www.lanmps.cn/uploadsis the mount point
Nfs is type
The soft parameter is used to output error messages to users.
In order to solve the network failure, the intr parameter can be terminated by pressing ctrl + c.

 


For more functions, see:

 

Http://www.server110.com/linux/201404/10169.html (thanks for providing)
Http://www.linuxidc.com/Linux/2013-05/84777.htm

Related Article

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.