文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>NFS使用小记

NFS使用小记

时间:2010-10-18  来源:landuochong

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

 

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

 

参考 Debian和Ubuntu Linux的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

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载