NFS简单配置方法
时间:2010-09-07 来源:yangzhigang
NFS简单配置方法
(来自:杨志刚 博客 http://yangzhigang.cublog.cn)
1) 配置文件:/etc/exports
Directory hostname (options)
Options可选,如不指定,则采用默认选项;
Hostname可以为空,空则表示代表任意外来主机;
Options,可ro为只读,rw为可读可写;
如:
/home www.xxx.com 再如:
/home 192.168.1.* (rw,async,no_root_squash)
rw;可读可写
async;同步,服务端只有接受到客户端的回应,才进行下一步,以确保连接更可靠
no_root_squash;不压缩root用户的权限,如要更安全请用roo_squash 可以用exportfs命令来输出exports对外共享的目录;
2) 确保启动portmap
# /etc/rc.d/init.d/portmap start
(or: # /service portmap start )
# /etc/rc.d/init.d/nfs start
(or: # /serverice nfs start) 注:可用netstat –untlp,来查看portmap和nfs服务是否启动,2049端口就是NFS服务器,111端口对应的就是portmap服务,可以发现在TCP和UDP上都有对应的端口;
3) NFS客户端配置
# mount –t nfs hostname(orIP):/directory /mountpoint
-t nfs可以省略;
/directory为绝对路径; 或是在/etc/fstab文件中增加NFS文件系统的挂载记录
NFSserverIP:/directory /mountpoint nfs defaults 0 0
(来自:杨志刚 博客 http://yangzhigang.cublog.cn)
1) 配置文件:/etc/exports
Directory hostname (options)
Options可选,如不指定,则采用默认选项;
Hostname可以为空,空则表示代表任意外来主机;
Options,可ro为只读,rw为可读可写;
如:
/home www.xxx.com 再如:
/home 192.168.1.* (rw,async,no_root_squash)
rw;可读可写
async;同步,服务端只有接受到客户端的回应,才进行下一步,以确保连接更可靠
no_root_squash;不压缩root用户的权限,如要更安全请用roo_squash 可以用exportfs命令来输出exports对外共享的目录;
2) 确保启动portmap
# /etc/rc.d/init.d/portmap start
(or: # /service portmap start )
# /etc/rc.d/init.d/nfs start
(or: # /serverice nfs start) 注:可用netstat –untlp,来查看portmap和nfs服务是否启动,2049端口就是NFS服务器,111端口对应的就是portmap服务,可以发现在TCP和UDP上都有对应的端口;
3) NFS客户端配置
# mount –t nfs hostname(orIP):/directory /mountpoint
-t nfs可以省略;
/directory为绝对路径; 或是在/etc/fstab文件中增加NFS文件系统的挂载记录
NFSserverIP:/directory /mountpoint nfs defaults 0 0
相关阅读 更多 +
排行榜 更多 +