因项目需要,简要记录NFS搭建过程。
NFS服务端版本为
[quote]# uname -a
HP-UX rx2660 B.11.31 U ia64 1374537878 unlimited-user license[/quote]
主机名为
[quote]# hostname
rx2660[/quote]
客户端版本为
[quote]# uname -a
HP-UX rp4440 B.11.23 U 9000/800 1943000290 unlimited-user license[/quote]
主机名为
[quote]# hostname
rp4440[/quote]
搭建过程如下
1、/etc/hosts文件中添加主机条目
在rx2660服务端/etc/hosts文件中添加
[quote]21.70.128.18 rx2660[/quote]
在rp4440 客户端/etc/hosts文件中添加
[quote]21.70.128.16 rp4440[/quote]
2、编译/etc/rc.config.d/nfsconf 配置文件
在rx2660服务端编辑以下条目
[quote]NFS_CLIENT=0
NFS_SERVER=1
PCNFS_SERVER=0
START_MOUNTD=1[/quote]
需要注意的是11.23版本还需编辑
[quote]NUM_NFSD=4
NUM_NFSIOD=4[/quote]
在rp4440 客户端编辑以下条目
[quote]NFS_CLIENT=1
NFS_SERVER=0
NUM_NFSD=0
NUM_NFSIOD=4
PCNFS_SERVER=0
START_MOUNTD=0[/quote]
3、启动nfs进程
在rx2660服务端启动nfs.core,nfs.server进程
[quote]# /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[/quote]
在rp4440客户端启动nfs.core,nfs.client进程
[quote]# /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 .
[/quote]
5、服务端配置/etc/exports文件
[quote]# more /etc/exports
/Tbackup -access=rp4440,anon=65534[/quote]
执行exp2dfs,将/etc/exports格式转成 /etc/dfs/dfstab格式
[quote]#exp2dfs
#exportfs -a
# /usr/sbin/showmount -e rx2660
export list for rx2660:
/Tbackup rp4440[/quote]
/etc/dfs/dfstab显示为
[quote]share -F nfs -o access=rp4440,anon=65534 /Tbackup[/quote]
注意:
[color=red]如果不执行exp2dfs,客户端rp4440不能挂载,这和HP-UX 11 v1和v2版本有本质区别[/color]
[quote]# mount rx2660:/Tbackup /Tbackup
Permission denied[/quote]
6、客户端/etc/fstab添加条目
[quote]rx2660:/Tbackup /Tbackup nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,vers=3,timeo=600,actimeo=0 0 2[/quote]
troubleshoot:
如果出现以下错误
[quote]# mount rx2660:/Tbackup /Tbackup
mount: /Tbackup: Stale NFS file handle[/quote]
只要umount,再重新mount即可
[quote]# umount /Tbackup
# mount /Tbackup[/quote]
NFS服务端版本为
[quote]# uname -a
HP-UX rx2660 B.11.31 U ia64 1374537878 unlimited-user license[/quote]
主机名为
[quote]# hostname
rx2660[/quote]
客户端版本为
[quote]# uname -a
HP-UX rp4440 B.11.23 U 9000/800 1943000290 unlimited-user license[/quote]
主机名为
[quote]# hostname
rp4440[/quote]
搭建过程如下
1、/etc/hosts文件中添加主机条目
在rx2660服务端/etc/hosts文件中添加
[quote]21.70.128.18 rx2660[/quote]
在rp4440 客户端/etc/hosts文件中添加
[quote]21.70.128.16 rp4440[/quote]
2、编译/etc/rc.config.d/nfsconf 配置文件
在rx2660服务端编辑以下条目
[quote]NFS_CLIENT=0
NFS_SERVER=1
PCNFS_SERVER=0
START_MOUNTD=1[/quote]
需要注意的是11.23版本还需编辑
[quote]NUM_NFSD=4
NUM_NFSIOD=4[/quote]
在rp4440 客户端编辑以下条目
[quote]NFS_CLIENT=1
NFS_SERVER=0
NUM_NFSD=0
NUM_NFSIOD=4
PCNFS_SERVER=0
START_MOUNTD=0[/quote]
3、启动nfs进程
在rx2660服务端启动nfs.core,nfs.server进程
[quote]# /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[/quote]
在rp4440客户端启动nfs.core,nfs.client进程
[quote]# /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 .
[/quote]
5、服务端配置/etc/exports文件
[quote]# more /etc/exports
/Tbackup -access=rp4440,anon=65534[/quote]
执行exp2dfs,将/etc/exports格式转成 /etc/dfs/dfstab格式
[quote]#exp2dfs
#exportfs -a
# /usr/sbin/showmount -e rx2660
export list for rx2660:
/Tbackup rp4440[/quote]
/etc/dfs/dfstab显示为
[quote]share -F nfs -o access=rp4440,anon=65534 /Tbackup[/quote]
注意:
[color=red]如果不执行exp2dfs,客户端rp4440不能挂载,这和HP-UX 11 v1和v2版本有本质区别[/color]
[quote]# mount rx2660:/Tbackup /Tbackup
Permission denied[/quote]
6、客户端/etc/fstab添加条目
[quote]rx2660:/Tbackup /Tbackup nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,vers=3,timeo=600,actimeo=0 0 2[/quote]
troubleshoot:
如果出现以下错误
[quote]# mount rx2660:/Tbackup /Tbackup
mount: /Tbackup: Stale NFS file handle[/quote]
只要umount,再重新mount即可
[quote]# umount /Tbackup
# mount /Tbackup[/quote]