NFS服务器的安装与配置
2013-03-22 13:03
239 查看
1.开启nfs服务
使用ntsysv查看系统开启的服务是否包含nfs
service portmap restart(nfs依赖的服务)
service nfs restart
2.执行如下命令编辑文件/etc/exports:
# vi /etc/exports
在该文件里添加如下内容:
/home/work 192.168.152.*(rw,sync,no_root_squash)
:wq
======内容解析===============================
添加的内容表示:允许ip 地址范围在192.168.0.*的计算机以读写的权限来访问/home/work 目录。
/home/work 也称为服务器输出共享目录。
括号内的参数意义描述如下:
rw:读/写权限,只读权限的参数为ro;
sync:数据同步写入内存和硬盘,也可以使用async,此时数据会先暂存于内存中,而不立即写入硬盘。
no_root_squash:NFS 服务器共享目录用户的属性,如果用户是 root,那么对于这个共享目录来说就具有 root 的权限。
/home/html 192.168.152.*(rw,sync,no_root_squash)
/home/index 192.168.152.*(rw,sync,no_root_squash)
mount -t nfs -o nolock 192.168.152.154:/home/html /mnt/html
mount -t nfs -o nolock 192.168.152.154:/home/index /mnt/index
======内容解析================================
3.更新信息
exportfs -a
service nfs restart
=====内容解析==================================
语法: exportfs [-aruv]
-a: 全部挂载(或卸载) /etc/exports档案内的设定
-r: 重新挂载/etc/exports里面的设定,也同步的更新/etc/exports和/var/lib/nfs/xtab里面的内容
-u:卸载某一目录
-v:在export的时候,将分享的目录显示到荧屏上.
例子
#exportfs -rv //重新export一次
#exportfs -au //全部卸载
=====内容解析==================================
4.客户端执行挂载
mount -t nfs -o nolock 192.168.152.154:/home/work /mnt/html
5.开机自动挂载
在/etc/rc.local下输入:
mount -t nfs -o nolock 192.168.152.154:/home/index /mnt/index
mount -t nfs -o nolock 192.168.152.154:/home/html /mnt/html
====其他方式===================================
方法一:
1、配置 /etc/fstab
192.168.152.151:/home/index /mnt/index nfs < options> 0 0
2、使用 mount -a让内核重新读取/etc/fstab 文件,可以看到挂载成功。
====其他方式====================================
使用ntsysv查看系统开启的服务是否包含nfs
service portmap restart(nfs依赖的服务)
service nfs restart
2.执行如下命令编辑文件/etc/exports:
# vi /etc/exports
在该文件里添加如下内容:
/home/work 192.168.152.*(rw,sync,no_root_squash)
:wq
======内容解析===============================
添加的内容表示:允许ip 地址范围在192.168.0.*的计算机以读写的权限来访问/home/work 目录。
/home/work 也称为服务器输出共享目录。
括号内的参数意义描述如下:
rw:读/写权限,只读权限的参数为ro;
sync:数据同步写入内存和硬盘,也可以使用async,此时数据会先暂存于内存中,而不立即写入硬盘。
no_root_squash:NFS 服务器共享目录用户的属性,如果用户是 root,那么对于这个共享目录来说就具有 root 的权限。
/home/html 192.168.152.*(rw,sync,no_root_squash)
/home/index 192.168.152.*(rw,sync,no_root_squash)
mount -t nfs -o nolock 192.168.152.154:/home/html /mnt/html
mount -t nfs -o nolock 192.168.152.154:/home/index /mnt/index
======内容解析================================
3.更新信息
exportfs -a
service nfs restart
=====内容解析==================================
语法: exportfs [-aruv]
-a: 全部挂载(或卸载) /etc/exports档案内的设定
-r: 重新挂载/etc/exports里面的设定,也同步的更新/etc/exports和/var/lib/nfs/xtab里面的内容
-u:卸载某一目录
-v:在export的时候,将分享的目录显示到荧屏上.
例子
#exportfs -rv //重新export一次
#exportfs -au //全部卸载
=====内容解析==================================
4.客户端执行挂载
mount -t nfs -o nolock 192.168.152.154:/home/work /mnt/html
5.开机自动挂载
在/etc/rc.local下输入:
mount -t nfs -o nolock 192.168.152.154:/home/index /mnt/index
mount -t nfs -o nolock 192.168.152.154:/home/html /mnt/html
====其他方式===================================
方法一:
1、配置 /etc/fstab
192.168.152.151:/home/index /mnt/index nfs < options> 0 0
2、使用 mount -a让内核重新读取/etc/fstab 文件,可以看到挂载成功。
====其他方式====================================
相关文章推荐
- Linux NFS服务器的安装与配置
- Ubuntu10.04安装与配置nfs服务器(转载)
- Linux NFS服务器安装与配置思路分析
- Linux NFS服务器的安装与配置
- Centos安装NFS服务器配置及挂载教程
- Linux NFS服务器的安装与配置
- nfs 服务器和客户端安装配置
- NFS服务器安装配置实现Ubuntu 12.04与ARM文件共享
- Ubuntu 14.04安装配置NFS服务器
- Linux - NFS服务器的安装与配置
- Linux NFS服务器的安装与配置
- Linux NFS服务器的安装与配置
- nfs服务器安装配置
- Linux NFS服务器的安装与配置
- CentOS下NFS服务器安装及配置实例
- CentOS下NFS服务器安装及配置实例
- nfs服务器安装配置
- Linux NFS服务器的安装与配置
- Linux NFS服务器的安装与配置
- Linux NFS服务器的安装与配置