Linux NFS搭建

来源:互联网 发布:访问mysql的客户端 编辑:程序博客网 时间:2024/05/18 14:22

NFS 安装:nfs-utils(主要NFS功能) portmap(RPC 端口分配)

1.安装

Ubuntu系统,通过apt-get安装:

apt-get install  nfs-kernel-server

NFS 配置文件

# vim/etc/exports 在这里可以对客户端各种权限的设置

/tmp*(rw,no_root_squash) #允许任何IP挂载/tmp目录


NFS启动

portmap启动

# serviceportmap start

或者

#/etc/init.d/portmap start

nfs启动

# servicenfs-kernel-server start

或者

#/etc/init.d/nfs-kernel-server start

# netstate-tunl | grep “111″ #查看portmap有没有启动

#chkconfig –list | grep“nfs” #查看nfs服务是否启动

# showmount-e localhost  #查看本地共享文件系统


NFS文件挂载

先在主机上尝试把/tmp挂载到/mnt下

local ]# mount127.0.0.1:/tmp /mnt   #进入/mnt查看

远程网络挂载

client ]# mount ServerIP:/tmp/mnt

 

 

 

 

将要共享的目录写到exports文件中 假设共享的目录为

     vim /etc/exports

     在exports文件中添加

/tmp *(rw,no_root_squash) #允许任何IP挂载/tmp目录


0 0