为什么80%的码农都做不了架构师?>>>
目录
一 环境
1.1 系统环境
1.2 软件环境
1.3 软件版本
二 安装
2.1 server 安装
2.2 server 启动
2.3 client 安装
2.4 client 挂载
三 验证
正文
一 环境
1.1 系统环境 CentOS 6.6 64位
[root@nfs-1 ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.6 (Final)
Release: 6.6
Codename: Final
[root@nfs-1 ~]# cat /proc/version
Linux version 2.6.32-504.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15 04:27:16 UTC 2014
1.2 软件环境
暂无
1.3 软件版本
yum 安装,一般都是安装最新版本
二 安装
2.1 安装
安装用户root
[root@scripts-1 ~]# yum install nfs-utils
2.2 启动
2.2.1
启动服务/etc/init.d/rpcbind restart
启动服务/etc/init.d/nfs restart
[root@scripts-1 ~]# /etc/init.d/rpcbind restart
Stopping rpcbind: [ OK ]
Starting rpcbind: [ OK ]
[root@scripts-1 ~]# /etc/init.d/nfs restart
Shutting down NFS daemon: [ OK ]
Shutting down NFS mountd: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down RPC idmapd: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
Starting RPC idmapd: [ OK ]
2.2.2 配置
主要配置文件 /etc/exports
官网描述:This file contains a list of entries; each entry indicates a volume that is shared and how it is shared. Check the man pages (man exports) for a complete description of all the setup options for the file, although the description here will probably satisfy most people's needs.
翻译(意翻):这个文件里 列出你要共享的目录,他被授权哪些客户端共享,客户端具有什么权限。
示例:
[root@nfs-1 etc]# less exports
/nfsc 10.59.0.0/16(rw,sync,acl,no_root_squash)
2.3 client 安装
客户端安装方法同server 端 安装。此处省
2.4 client 挂载
server 端,client 端都建共享目录
mkdir /nfsdir
client 端执行
mount -t nfs -o rw serverip:/nfsdir /nfsdir
三 验证
client 端 执行 mount 命令
就可以看看是否挂载成功
后记: 写的不好,其实配置这块有好多东西。。。
http://www.cnblogs.com/mchina/archive/2013/01/03/2840040.html
这篇文章虽然有点老,但是东西还全
这个是官网:不过是英文,实在不想翻译这个。。。
http://nfs.sourceforge.net/nfs-howto