CentOS6.6 Shared File Mounting between servers

Source: Internet
Author: User

CentOS6.6 Shared File Mounting between servers

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. Yuminstallnfs-utils

2. Set the service to start [plain] view plaincopyprint?
  1. Chkconfigrpcbindon
  2. Chkconfignfson
3. Start the service [plain] view plaincopyprint?
  1. Servicerpcbindstart
  2. Servicenfsstart
Centos Server 1 set [plain] view plaincopyprint?
  1. /Www/wwwroot/www.lanmps.com/uploads192.168.1.20 (rw, no_root_squash, no_all_squash, sync)

Then reload [plain] view plaincopyprint?
  1. Exportfs-r
View [plain] view plaincopyprint in the shared list?
  1. Exportfs
Centos Server 2 settings 1. Check if Server 1 has shared [plain] view plaincopyprint?
  1. Showmount-e192.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-tnfs-orw192.168.1.100:/www/wwwroot/www.lanmps.com/uploads/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 shared [plain] view plaincopyprint?
  1. Umount/www/wwwroot/www.lanmps.com/uploads
6. Set the Mounting Mode for boot. method 1 (recommended): edit the/etc/rc. local file and add the [html] view plaincopyprint?
  1. Mount-tnfs-orw192.168.1.100:/www/wwwroot/www.lanmps.com/uploads/www/wwwroot/www.lanmps.com/uploads
Method 2: edit/etc/fstab and find that this item is not successful. The network function is loaded at the end. Therefore, recommended method 1.

[Html] view plaincopyprint?
  1. 192.168.1.100:/www/wwwroot/www.lanmps.cn/uploads/www/wwwroot/www.lanmps.cn/uploadsnfsdefaults,soft,intr00
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

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.