NFS服务端版本为
引用
# uname -a
HP-UX rx2660 B.11.31 U ia64 1374537878 unlimited-user license
HP-UX rx2660 B.11.31 U ia64 1374537878 unlimited-user license
主机名为
引用
# hostname
rx2660
rx2660
客户端版本为
引用
# uname -a
HP-UX rp4440 B.11.23 U 9000/800 1943000290 unlimited-user license
HP-UX rp4440 B.11.23 U 9000/800 1943000290 unlimited-user license
主机名为
引用
# hostname
rp4440
rp4440
搭建过程如下
1、/etc/hosts文件中添加主机条目
在rx2660服务端/etc/hosts文件中添加
引用
21.70.128.18 rx2660
在rp4440 客户端/etc/hosts文件中添加
引用
21.70.128.16 rp4440
2、编译/etc/rc.config.d/nfsconf 配置文件
在rx2660服务端编辑以下条目
引用
NFS_CLIENT=0
NFS_SERVER=1
PCNFS_SERVER=0
START_MOUNTD=1
NFS_SERVER=1
PCNFS_SERVER=0
START_MOUNTD=1
需要注意的是11.23版本还需编辑
引用
NUM_NFSD=4
NUM_NFSIOD=4
NUM_NFSIOD=4
在rp4440 客户端编辑以下条目
引用
NFS_CLIENT=1
NFS_SERVER=0
NUM_NFSD=0
NUM_NFSIOD=4
PCNFS_SERVER=0
START_MOUNTD=0
NFS_SERVER=0
NUM_NFSD=0
NUM_NFSIOD=4
PCNFS_SERVER=0
START_MOUNTD=0
3、启动nfs进程
在rx2660服务端启动nfs.core,nfs.server进程
引用
# /sbin/init.d/nfs.core start
Starting NFS CORE networking
rpcbind already started, using pid: 910
# /sbin/init.d/nfs.server start
Starting NFS SERVER subsystem
Reading in /etc/dfs/dfstab
Starting up the mount daemon
rpc.mountd already started, using pid: 1817
Starting up the NFS server daemon
nfsd already started, using pid: 1823
Starting up nfsmapid daemon
Starting NFS CORE networking
rpcbind already started, using pid: 910
# /sbin/init.d/nfs.server start
Starting NFS SERVER subsystem
Reading in /etc/dfs/dfstab
Starting up the mount daemon
rpc.mountd already started, using pid: 1817
Starting up the NFS server daemon
nfsd already started, using pid: 1823
Starting up nfsmapid daemon
在rp4440客户端启动nfs.core,nfs.client进程
引用
# /sbin/init.d/nfs.core start
starting NFS CORE networking
starting up the rpcbind
rpcbind already started, using pid: 838
# /sbin/init.d/nfs.client start
starting NFS CLIENT networking
starting up the rpcbind
rpcbind already started, using pid: 838
starting up the BIO daemons
/usr/sbin/biod 4
starting up the Status Monitor daemon
/usr/sbin/rpc.statd
starting up the Lock Manager daemon
/usr/sbin/rpc.lockd
Starting up the AutoFS daemon
/usr/sbin/automountd
Running the AutoFS command interface
/usr/sbin/automount
mounting remote NFS file systems ...
mounting CacheFS file systems .
starting NFS CORE networking
starting up the rpcbind
rpcbind already started, using pid: 838
# /sbin/init.d/nfs.client start
starting NFS CLIENT networking
starting up the rpcbind
rpcbind already started, using pid: 838
starting up the BIO daemons
/usr/sbin/biod 4
starting up the Status Monitor daemon
/usr/sbin/rpc.statd
starting up the Lock Manager daemon
/usr/sbin/rpc.lockd
Starting up the AutoFS daemon
/usr/sbin/automountd
Running the AutoFS command interface
/usr/sbin/automount
mounting remote NFS file systems ...
mounting CacheFS file systems .
5、服务端配置/etc/exports文件
引用
# more /etc/exports
/Tbackup -access=rp4440,anon=65534
/Tbackup -access=rp4440,anon=65534
执行exp2dfs,将/etc/exports格式转成 /etc/dfs/dfstab格式
引用
#exp2dfs
#exportfs -a
# /usr/sbin/showmount -e rx2660
export list for rx2660:
/Tbackup rp4440
#exportfs -a
# /usr/sbin/showmount -e rx2660
export list for rx2660:
/Tbackup rp4440
/etc/dfs/dfstab显示为
引用
share -F nfs -o access=rp4440,anon=65534 /Tbackup
注意:
如果不执行exp2dfs,客户端rp4440不能挂载,这和HP-UX 11 v1和v2版本有本质区别
引用
# mount rx2660:/Tbackup /Tbackup
Permission denied
Permission denied
6、客户端/etc/fstab添加条目
引用
rx2660:/Tbackup /Tbackup nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,vers=3,timeo=600,actimeo=0 0 2
troubleshoot:
如果出现以下错误
引用
# mount rx2660:/Tbackup /Tbackup
mount: /Tbackup: Stale NFS file handle
mount: /Tbackup: Stale NFS file handle
只要umount,再重新mount即可
引用
# umount /Tbackup
# mount /Tbackup
# mount /Tbackup