wildgoat的个人空间 https://blog.eetop.cn/wildgoat [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

[ZZ]CentOS 6 NFS的安装配置

已有 1121 次阅读| 2014-3-20 23:37 |个人分类:软件使用

NFS的安装配置:
centos 5 :
yum install nfs-utils portmap
centos 6 :
yum install nfs-utils rpcbind


本节是使用centos 6的配置过程:
设备:两台 centos6 OS 安装的时候选择的是"Basic Server"软件配置包。
首先,让两台机器都安装NFS的 软件包,如下显示的是服务器端:
[root@roothomes /home]$ yum install nfs-utils rpcbind
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn
Setting up Install Process
Package rpcbind-0.2.0-8.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.2.3-15.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch            Version                 Repository     Size
================================================================================
Updating:
 nfs-utils          x86_64          1:1.2.3-15.el6          base          308 k

Transaction Summary
================================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total download size: 308 k
Is this ok [y/N]: y
Downloading Packages:
nfs-utils-1.2.3-15.el6.x86_64.rpm                        | 308 kB     00:10
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
base/gpgkey                                              | 3.3 kB     00:00 ...
Importing GPG key 0xC105B9DE "CentOS-6 Key (CentOS 6 Official Signing Key) <cent                                                                                                                                                              os-6-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : 1:nfs-utils-1.2.3-15.el6.x86_64                          1/2
  Cleanup        : 1:nfs-utils-1.2.2-7.el6.x86_64                           2/2

Updated:
  nfs-utils.x86_64 1:1.2.3-15.el6

Complete!
[root@roothomes /home]$

服务器端:
###(建立挂载的目录,并且挂载目录。)
[root@roothomes /etc]$ mkdir /opt/centos6
[root@roothomes /etc]$ cd /opt/centos6/
[root@roothomes /opt/centos6]$ mkdir thisISnfsFile
[root@roothomes /opt/centos6]$ ls
thisISnfsFile
[root@roothomes /etc]$ vi /etc/exports
[root@roothomes /opt/centos6]$ cat /etc/exports

/opt/centos6 192.168.1.0/24(ro,no_root_squash)
### 备注:/opt/centos6表示nfs共享的目录 192.168.1.0-192.168.1.254区间的IP可以访问,访问权限是自读,root 用户
###(启动对应的服务)
[root@roothomes /opt/centos6]$ chkconfig nfs on
[root@roothomes /opt/centos6]$ /etc/init.d/rpcbind start
[root@roothomes /opt/centos6]$ /etc/init.d/nfs start
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
[root@roothomes /opt/centos6]$ service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]


客户端:
[root@roothomes /home]$ yum install nfs-utils rpcbind
安装完毕!
[root@vmBS00 ~]# service iptables stop
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
###查看是否能访问nfs服务
[root@vmBS00 ~]# showmount -e 192.168.1.75
Export list for 192.168.1.75:
/opt/centos6 192.168.1.0/24
[root@vmBS00 ~]# mkdir /opt/centos6
[root@vmBS00 ~]# mount -t nfs 192.168.1.75:/opt/centos6/  /opt/centos6/
[root@vmBS00 ~]# ls /opt/centos6/
thisISnfsFile
###配置开机自动挂载
[root@vmBS00 ~]# vi /etc/fstab
### 添加 #192.168.1.75:/opt/centos6/ /opt/centos6/ nfs nodev,ro,rsize=32768,wsize=32768 0 0

[root@vmBS00 ~]# init 6
[root@vmBS00 ~]#
login as: root
root@192.168.1.116's password:
Last login: Mon Mar  5 17:29:04 2012 from 192.168.1.23
[root@vmBS00 ~]# ls /opt/centos6/
thisISnfsFile
[root@vmBS00 ~]#

点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 122

    粉丝
  • 42

    好友
  • 274

    获赞
  • 118

    评论
  • 22104

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-9 02:21 , Processed in 0.015193 second(s), 7 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部