在AIX系统中,我们如何开启NFS呢?这个问题本文来帮助大家解决一下。首先让我们看看都需要哪些准备工作。具体过程如下:
1、准备AIX服务器
默认安装完AIX5.3后,先停止nfs和portmap两个进程,然后删掉一些和NFS有关的文件
# stopsrc -g nfs
0513-044 The biod Subsystem was requested to stop.
0513-044 The nfsd Subsystem was requested to stop.
0513-044 The rpc.mountd Subsystem was requested to stop.
0513-044 The rpc.lockd Subsystem was requested to stop.
0513-044 The rpc.statd Subsystem was requested to stop.
#
-g表示停止一组nfs相关的进程
# stopsrc -s portmap
0513-044 The portmap Subsystem was requested to stop.
#
# cd /etc
# rm -rf sm sm.bak state xtab rmtab
2、配置AIX的NFS服务器
可以直接手动配置/etc/exports或使用smit工具配置,因为AIX的NFS和Linux的配置文件内容不同,所以建议使用smit工具来配
这是我通过smit配置好的/etc/exports文件内容:
# cat /etc/exports
/mnt -sec=sys:krb5p:krb5i:krb5:dh:none,rw,root=192.168.3.160,access=192.168.3.161:192.168.3.160
#
我将/mnt目录共享出去,设置只允许192.168.3.160可以对共享目录写操作,能够访问的服务器有192.168.3.161和192.168.3.160,sec是数据加密方法.配置完后,使用exportfs命令将/etc/exports的内容更新至/etc/xtab文件中,/etc/xtab文件是NFS读取的内容,所以这步很关键,如果不用这个命令,其它的节点是无法正确挂载NFS共享目录的:
# exportfs -a
这里要注意一下:NFS客户端的IP地址要写到/etc/hosts文中,并要指定机器名,否则是无法挂载AIX上的NFS共享目录
3、启动NFS并测试
# startsrc -s portmap
0513-059 The portmap Subsystem has been started. Subsystem PID is 233644.
# startsrc -g nfs
0513-059 The biod Subsystem has been started. Subsystem PID is 245894.
0513-059 The nfsd Subsystem has been started. Subsystem PID is 213136.
0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 172270.
0513-059 The nfsrgyd Subsystem has been started. Subsystem PID is 217294.
0513-059 The gssd Subsystem has been started. Subsystem PID is 221400.
0513-059 The rpc.lockd Subsystem has been started. Subsystem PID is 217296.
0513-059 The rpc.statd Subsystem has been started. Subsystem PID is 221402.
#
在AIX上查看NFS的共享目录
# showmount -e localhost
export list for localhost:
/mnt (everyone)
#
在Linux上查看AIX的NFS共享目录:
test01:~ # showmount -e 192.168.3.162
Export list for 192.168.3.162:
/mnt (everyone)
test01:~ #
Linux系统挂载NFS目录
test01:~ # mount 192.168.3.162:/mnt /mnt.
本篇文章来源于 黑客天下 原文链接:http://www.hack4.com/article/hack4-10061.html