Chinaunix首页 | 论坛 | 博客
  • 博客访问: 163951
  • 博文数量: 46
  • 博客积分: 2981
  • 博客等级: 少校
  • 技术积分: 475
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-01 12:43
文章分类

全部博文(46)

文章存档

2010年(4)

2009年(9)

2008年(33)

我的朋友

分类: 系统运维

2009-09-14 20:15:40

1. server 端

例如可以编辑/etc/exports为:
/tmp     *(rw,no_root_squash)
/home/public 192.168.0.*(rw)   *(ro)
/home/test  192.168.0.100(rw)
/home/linux  *.the9.com(rw,all_squash,anonuid=40,anongid=40)
设定好后可以使用以下命令启动NFS:
/etc/rc.d/init.d/portmap start (在REDHAT中PORTMAP是默认启动的)
/etc/rc.d/init.d/nfs start

exportfs命令:
如果我们在启动了NFS之后又修改了/etc/exports,是不是还要重新启动nfs呢?这个时候我们就可以用exportfs命令来使改动立刻生效,该命令格式如下:
exportfs [-aruv]
-a :全部mount或者unmount /etc/exports中的内容
-r :重新mount /etc/exports中分享出来的目录
-u :umount 目录
-v :在 export 的?r候,将详细的信息输出到屏幕上。
具体例子:
[root @test root]# exportfs -rv <==全部重新 export 一次!
exporting 192.168.0.100:/home/test
exporting 192.168.0.*:/home/public
exporting *.the9.com:/home/linux
exporting *:/home/public
exporting *:/tmp
reexporting 192.168.0.100:/home/test to kernel

exportfs -au <==全部都卸载了。

2. client

客户段的操作:
1、showmout命令对于NFS的操作和查错有很大的帮助,所以我们先来看一下showmount的用法
showmout
-a :这个参数是一般在NFS SERVER上使用,是用来显示已经mount上本机nfs目录的cline机器。
-e :显示指定的NFS SERVER上export出来的目录。
例如:
showmount -e 192.168.0.30
Export list for localhost:
/tmp *
/home/linux *.linux.org
/home/public (everyone)
/home/test 192.168.0.100
2、mount nfs目录的方法:
mount -t nfs hostname(orIP):/directory /mount/point
具体例子:
Linux: mount -t nfs 192.168.0.1:/tmp /mnt/nfs
Solaris:mount -F nfs 192.168.0.1:/tmp /mnt/nfs
BSD: mount 192.168.0.1:/tmp /mnt/nfs

可以用两三个web服务器 来共享一个文件服务器 .

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

上一篇:C语言中的一些问题

下一篇:C 程序国际化

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