File Sharing between linux and file sharing in linux

Source: Internet
Author: User

File Sharing between linux and file sharing in linux

Because an application was loaded yesterday, the application will upload files. To ensure file synchronization, you need to share a file. In Linux, Network File Service (Network File System NFS) can be used to share files.

Generally, the NFS system is installed in linux by default. First, set host A. A directory in host A is shared and can be read and written by other hosts.

Vi/etc/exports # set in this file

/Home/work * (rw, sync, no_root_squash)

This statement indicates that all hosts can share/home/work on host A. the permissions are as follows:

Rw: read/write permission. the read-only permission is ro;

Sync: indicates that all data is written to the shared data upon request, that is, data is synchronized to the memory and hard disk;

No_root_squash: Allows clients mounted to this directory to enjoy the root identity of the host.

Edit and save and execute the following command:

Servicenfs restart ---- Enable nfs service

Showmount-e 172.16.50.21 (this command can check all mounted directories on the host)

For host B (the directory that needs to be shared with A), perform the following operations:

Vi/etc/fstab

172.16.50.21:/home/apache-tomcat-7.0.34/webapps/CHMOManager/download/softversion/home/tomcat/apache-tomcat-7.0.34/webapps/CHMOManager/download/softversion nfs ults 0 0

In this example, the file system of directory 21 is nfs, which is shared to host B/home/tomcat/apache-tomcat-7.0.34/webapps/CHMOManager/download/softversion, ults is the default configuration

Then run mount-a to mount the file. (Do not run this command in the shared directory. Otherwise, the command cannot be executed)

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.