Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3423538
  • 博文数量: 864
  • 博客积分: 14125
  • 博客等级: 上将
  • 技术积分: 10634
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-27 16:53
个人简介

https://github.com/zytc2009/BigTeam_learning

文章分类

全部博文(864)

文章存档

2023年(1)

2021年(1)

2019年(3)

2018年(1)

2017年(10)

2015年(3)

2014年(8)

2013年(3)

2012年(69)

2011年(103)

2010年(357)

2009年(283)

2008年(22)

分类: LINUX

2010-10-18 08:53:32

开始捣腾Linux下的各种服务器应用(环境:vmware,ubuntu-9.04-server)。

 

今天先设置了NFS,方便以后各虚拟机之间到文件操作。

 

参考 

 

简要记下自己的理解:

 

1、程序构成:

   /etc/init.d/nfs-kernel-server    服务器端脚本,维护nfsd进程,nfsd运行在RPC基础上

     /etc/init.d/portmap                  服务器端,客户端都要用的脚本,负责RPC的端口映射

       /nfs-common                           nfs客户端支持

2、安装:

  服务器端:

sudo apt-get install nfs-kernel-server

                 会自动安装nfs-common, portmap

      客户端:

sudo apt-get install nfs-common

 

3、配置:

    portmap:

                修改 /etc/default/portmap 注释掉  OPTIONS="-i 127.0.0.1"

                或 sudo dpkg-reconfigure portmap, 选择 “No”

  访问控制:

     修改 /etc/hosts.deny, 添加
                ### NFS DAEMONS

               portmap: ALL

        lockd: ALL

               rquotad: ALL

       mountd: ALL

               statd: ALL

               修改  /etc/hosts.allow, 添加

                ### NFS DAEMONS

              
portmap: 192.168.1.

        lockd: 192.168.1.

              
rquotad: 192.168.1.

       mountd: 192.168.1.

               statd: 192.168.1.

        NFS共享设置:

               修改  /etc/exports, 添加共享, 如: 将 /home/cc/share 共享给 192.168.1.×,权限rw

                       /home/cc/share 192.168.203.*(rw,sync,no_root_squash,no_subtree_check)

               使用 exportfs -r 刷新共享列表,使配置生效

                       sudo exportfs -r

4、重启服务:

               sudo /etc/init.d/portmap restart

               sudo /etc/init.d/nfs-kernel-server restart

5、查看nfs共享列表, mount nfs目录:

               查看:

sudo showmount -e nfs-server主机地址

               挂载:

sudo mount [-o 参数] nfs-server主机地址:/共享目录   /目标目录

如:  sudo mount  192.168.1.2:/home/cc/share  /mnt

阅读(726) | 评论(0) | 转发(0) |
0

上一篇:Shell编程基础

下一篇:NFS使用方法详解

给主人留下些什么吧!~~