前提是两个机器防火墙都关闭了的情况下service iptables stop

查看是否安装了portmap

重启nfs服务器
service nfs restart
chkconfig nfs on 设置开机自动启动
vim /etc/exports 修改nfs的配置文件

service nfs restart 再次重启
到客户机查看共享:showmount -e 192.168.18.104

挂载到客户机的/data目录里面



不能创建文件,因为配置中/pub文件是只读,而且服务端也没有给权限
那么我们来挂载/test文件
服务端:

客户端:
mount -t nfs 192.168.18.104:/test /data2
可以查看服务端的文件:

同上面一样也不能创建
在服务端:chmod o+w /test
这样,就创建了文件,需要在配置中配置可读可写,再在服务端给文件加权限才行
-rw-r--r-- 1 nfsnobody nfsnobody 0 Jan 19 02:18 lalal
-------------------------------------------------------------------------
补充:
客户机
当Client连接RPC Server所提供的服务时,Client需要一个可以连接的端口
端口控制:portmap,yum -y install nfs-utils portmap 默认是已经安装成功的
nfs共享的常见参数:,逗号‘,’隔开
ro 只读访问
rw 读写访问
sync 所有数据在请求时候写入共享
secure nfs通过1024以下端口发送
insecure 通过1024以上端口发送
Hide 在nfs共享时候不共享子目录
no_hide 共享子目录
all_sqush 共享文件的uid和gid映射匿名用户anonymous,适合公共目录
no_root_squash root用户具有根目录的完全访问权限
anonuid=xxx 指定nfs服务器/etc/passwd 文件中匿名用户的uid
NFS管理:
exports
-a:全部mount或者umount /etc/exports 中的内容
-r :重新mount 、/etc/exports中分享出来的目录
-u : umount 目录
-v: 查看
exports -au 卸载所有共享的目录
exports -rv 重新共享所有目录并输出详细信息
客户端挂载:
mount -t nfs hostname(orIp):/目录 /目录
chkconfig --list |grep rpc 查看开机自启动列表,筛选出来rpc
------------------------------------------------------------------------------------------------
Linux进程管理
ps,ps aux ,top,iostat,ps tree,vmstat ,sar
1,ps:进程监控命令





ps aux



2:top

,3,sar:
rpm -ivh sysstat-7.0.2-3.el5_5.1.i386.rpm

4,iostat:

