Ways to share files between Linux: Application for NFS software Local Installation

Source: Internet
Author: User
Tags gpg

1. First talk about the difference between Nfs,ftp,samba:

Configuring and enabling a file server is necessary for a real-world operating environment. Storing and managing important data is clearly more secure than distributed storage. For this reason, it is recommended that the system administrator prepare and enable the file server as a basic management policy.

Depending on the way you use it, you can divide it into 3 categories of file Servers: FTP server (FTP/TFTP), Samba server, and NFS server. FTP customers can be any platform, Samba is dedicated to Windows customers, and NFS is for Linux/unix users. Here are the comparison of the three types of servers:

Server name User Client platform use range service port

FTP Windows/linux/unix/macos and other publishing sites, file sharing TCP/21

Samba Windows File Share (Network Neighborhood) tcp/445,tcp/139

NFS Linux/unix Web site Publishing, file sharing (Mount) tcp/2049

(Refer to: http://blog.csdn.net/HUGH0001/article/details/4813035)


2. Mount the local Yum source.

Real-network development in order to avoid the Internet insecurity, inconvenient and so on factors can not be networked, so we have to configure the local Yum source. That is to read the RPM package from the packages inside the Centos-6.6-i386-bin-dvd1.iso.

Centos5. X rpm may not be the same, it is in the CentOS directory of the ISO file, the system is different and may not be the same.

My machine is: CentOS release 6.6 (Final)

[Email protected] ~]# Cat/etc/issuecentos release 6.6 (Final)

Mount/dev/cdrom1 to /mnt/cdrom

mkdir /mnt/cdrommount /dev/cdrom1 /mnt/cdrom[[email protected] cdrom]# cd / mnt/cdrom/[[email protected] cdrom]# lscentos_buildtag  packages                      rpm-gpg-key-centos-security-6eula              RELEASE-NOTES-en-US.html    RPM-GPG-KEY-CentOS-Testing-6GPL               repodata                     trans. tblimages           rpm-gpg-key-centos-6isolinux          rpm-gpg-key-centos-debug-6[[email protected] cdrom]#  cd packages/[[email protected] paCkages]# ll | head -n 5total 3724263-r--r--r--.  2 root root   1555852 oct 17 12:54 389-ds-base-1.2.11.15-46.el6.i686.rpm-r--r--r--.  2  root root   433236 oct 17 12:55 389- Ds-base-libs-1.2.11.15-46.el6.i686.rpm-r--r--r--.  2 root root   215288 oct  17 12:54 abrt-2.0.8-26.el6.centos.i686.rpm-r--r--r--.  2 root root    119572 oct 17 12:56 abrt-addon-ccpp-2.0.8-26.el6.centos.i686.rpm

The Yum configuration file needs to be changed:

Backup

[Email protected] ~]# Cp/etc/yum.repos.d/centos-media.repo/etc/yum.repos.d/centos-media.repo.bak

My Centos-media.repo is well-configured, and this change is:

[[email protected] ~]# cat /etc/yum.repos.d/centos-media.repo# centos-media.repo##   this repo can be used with mounted dvd media, verify  the mount point for#  centos-6.  you can use this  repo and yum to install items directly off the#  dvd  iso that we release.## to use this repo, put in your  dvd and use it with the other repos too:#  yum -- enablerepo=c6-media [command]## or for only the media repo, do  this:##  yum --disablerepo=\* --enablerepo=c6-media [command][c6-media]name=centos-$ Releasever - mediabaseurl=        file:///mnt/cdrom/gpgcheck =0enabled=1gpgkey=file:///Etc/pki/rpm-gpg/rpm-gpg-key-centos-6 

#note 1:

baseurl=file:///media/centos/

file:///mnt/cdrom/ #保留这一个, the other is useless, this address is the address just mounted.
file:///media/cdrecorder/

#note 2:

Gpgcheck=0 #0 said to remove the test, do not go can also, possible problems, and then back to change the problem.

Enabled=1 # 1 indicates that local yum is enabled. must be changed to 1.

(yum local Yum source to improve Yum speed, refer to http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html)

Well configured, we tested Yum search http*, and the results were found, and the configuration was successful.

3. Install NFS:


Note the test environment: CentOS 6.6 Other versions (5.x) may not be the same

ip:172.100.11.231

Install the NFS suite first, with the following command:

#yum Install nfs-utils.x86_64 (64-bit system)

Yum Install Nfs-utils (32-bit system)

Installing the RPC Service

Yum Install Rpcbind


Start the service

Service Rpcbind Start

Service NFS Start

To create a shared directory:

Mkdir–p/data/nfsshare

Edit/etc/exports FileReload the exports file


View the NFS directory for native Publishing

Showmount–e


Then find a machine with the same network segment 172.100.11.230 as the client

Viewing a list of available mounts

Showmount–e IP #这个ip就是你刚才安装nfs的机器ip, see what files this server has assigned to other machines

Mount Server Directory

Mount–t nfs–o Nolock [host name or ip]:[server directory path] [client directory path]


To test

(See http://www.cnblogs.com/kaka/archive/2013/03/08/2950236.html For more Rights Management configuration details)

Ways to share files between Linux: Application for NFS software Local Installation

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.