AIX 开机自动挂载NFS共享
当Oracle搭建在AIX系统上,进行集中备份时,可能需要通过连接Backup server挂载NFS共享来讲数据备份到存储设备上。
在Linux环境下,如想实现NFS开机自动挂载,通常只要在/etc/fstab中添加相应记录即可。
在AIX系统中,即使在相应目录/etc/filesystems中添加了对应挂载信息并设置mount参数为true,有时也难以实现开机自动挂载。
本文通过实验,解决AIX挂载NFS共享时报错:Vmount:Not owner 问题,并实现AIX环境下开机自动挂载Linux NFS共享。
【实验环境】
NFS客户端 操作系统: AIX 5300-09NFS服务器 操作系统:RHEL 5.4
【实验背景】
进行oracle数据库集中备份时,Backup Server (rhel)连接到磁盘阵列。然后通过NFS共享存储空间供各个数据库服务器存储备份文件。各数据库服务器(AIX系统)作为客户端挂载对应NFS共享,即可备份时通过Backup Server将备份文件存储在阵列上。
与Linux系统不同,当AIX作为NFS客户端,挂载NFS共享时,需调整AIX默认网络参数。
若想实现开机启动,必须将网络参数值写入nextboot file。
【实验过程】
1、查看NFS共享
showmount -e rhel152 | grep aix227共享存储的位置为 rhel152:/backup/cuug02/storage03
2、编辑/etc/filesystems
vi /etc/filesystems
mount=true 即开机自动挂载
3、手工mount报错
mount /backup咦?linux系统中只要做类似配置,即可成功挂载,到了AIX系统怎么就不行了呢?
难道是编辑的配置有问题?
4、使用smit查看相应配置
为验证NFS的配置信息,删除/etc/filesystems中所添加信息,使用smit nfs 重新进行配置下图陪配置信息中
/etc/filesystems entry will mount the directory on system restart 选项 设置为 yes
即 开机自动挂载
配置完毕后 回车 显示 failed
仍然报错,Not owner
5、调整默认网路参数
查看相关资料,出现此报错信息,需要调整AIX默认网络参数nfso -o nfs_use_reserved_ports=1
调整完毕后再次手动挂载无报错信息
mount /backup
df -g查看,已成功挂载NFS服务器共享目录到本地文件系统
6、重启AIX系统验证
上面手动挂载成功后,还需重启AIX系统看是否能够实现开机自动挂载shutdown -Fr 重启AIX系统
7、重启后手工mount再次失败
重启后查看NFS未成功挂载,手工mount失败,依然报相同错smit nfs查看相关信息,开机挂载选项的确是yes
从上面报错信息看出,还是网络参数需要调整。
那如果每次挂载前都需要调整,就无法实现开机自动挂载了。
能不能将此参数设置为永久生效呢?
8、查看nfso 相关参数
man nfso 查看nfso命令手册 其中-o 和 -p 参数介绍如下- -o Tunable[ =NewValue ]
- Displays the value or sets Tunable to NewValue. If a tunable needs to be changed (the specified value is different
- than current value), and is of type Bosboot or Reboot, or if it is of type Incremental and its current value is bigger
- than the specified value, and -r is not used in combination, it will not be changed but a warning displays instead.
- When -r is used in combination without a new value, the nextboot value for the Tunable displays. When -p is used in
- combination without a NewValue, a value displays only if the current and next boot values for the Tunable are the
- same. Otherwise NONE displays as the value.
-
- -p
- Makes changes apply to both current and reboot values, when used in combination with -o, -d or -D, that is, it turns
- on the updating of the /etc/tunables/nextboot file in addition to the updating of the current value. These
- combinations cannot be used on Reboot and Bosboot type parameters because their current value cannot be changed.
- When used with -a or -o without specifying a new value, values are displayed only if the current and next boot values
- for a parameter are the same. Otherwise NONE displays as the value.
从上面看出,使用-p 参数结合-o 或者-d 、-D,不仅可以更新当前值,还可以写入 /etc/tunables/nextboot 文件,同时修改当前值和reboot后的值。
9、重新设置网络参数
nfso -p -o nfs_use_reserved_ports=1提示信息显示写入了nextboot file
查看/etc/tunables/nextboot 新增加我们刚刚设置的参数
手动mount,挂载NFS成功不报错
10、重启查验,自动挂载成功
shutdonw -Fr 再次重启AIX系统查验自动挂载NFS成功,实现了AIX系统开机自动挂载NFS
11、查看网络参数及nextbootfile
查看/etc/tunables/nextboot 文件,发现有我们为安装oracle而调整的参数,还有刚刚为挂载nfs而设置的nfs_use_reserved_ports参数
使用nfso -L命令,以图表方式查看网络参数
其中挂载nfs需修改的网络参数nfs_use_reserved_ports参数,当前值是1,默认值是0
- [root@aix227:/]#nfso -L
- NAME CUR DEF BOOT MIN MAX UNIT TYPE
- DEPENDENCIES
- --------------------------------------------------------------------------------
- portcheck 0 0 0 0 1 On/Off D
- --------------------------------------------------------------------------------
- udpchecksum 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_socketsize 600000 600000 600000 40000 1280K Bytes D
- --------------------------------------------------------------------------------
- nfs_tcp_socketsize 600000 600000 600000 40000 1280K Bytes D
- --------------------------------------------------------------------------------
- nfs_setattr_error 0 0 0 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_gather_threshold 4K 4K 4K 512 8K+1 Bytes D
- --------------------------------------------------------------------------------
- nfs_repeat_messages 0 0 0 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_udp_duplicate_cache_size
- 5000 5000 5000 5000 100000 Req I
- --------------------------------------------------------------------------------
- nfs_tcp_duplicate_cache_size
- 5000 5000 5000 5000 100000 Req I
- --------------------------------------------------------------------------------
- nfs_server_base_priority 0 0 0 31 125 Pri D
- --------------------------------------------------------------------------------
- nfs_dynamic_retrans 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_iopace_pages 0 0 0 0 64K-1 Pages D
- --------------------------------------------------------------------------------
- nfs_max_connections 0 0 0 0 10000 Number D
- --------------------------------------------------------------------------------
- nfs_max_threads 3891 3891 3891 5 3891 Threads D
- --------------------------------------------------------------------------------
- nfs_use_reserved_ports 1 0 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_device_specific_bufs 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_server_clread 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_rfc1323 0 0 0 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_max_write_size 32K 32K 32K 512 64K Bytes D
- --------------------------------------------------------------------------------
- nfs_max_read_size 32K 32K 32K 512 64K Bytes D
- --------------------------------------------------------------------------------
- nfs_allow_all_signals 0 0 0 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_v2_pdts 1 1 1 1 8 PDTs M
- --------------------------------------------------------------------------------
- nfs_v3_pdts 1 1 1 1 8 PDTs M
- --------------------------------------------------------------------------------
- nfs_v2_vm_bufs 10000 10000 10000 512 50000 Bufs I
- --------------------------------------------------------------------------------
- nfs_v3_vm_bufs 10000 10000 10000 512 50000 Bufs I
- --------------------------------------------------------------------------------
- nfs_securenfs_authtimeout 0 0 0 0 60 Seconds D
- --------------------------------------------------------------------------------
- nfs_v3_server_readdirplus 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- lockd_debug_level 0 0 0 0 10 Level D
- --------------------------------------------------------------------------------
- statd_debug_level 0 0 0 0 10 Level D
- --------------------------------------------------------------------------------
- statd_max_threads 50 50 50 1 1000 Threads D
- --------------------------------------------------------------------------------
- nfs_v4_fail_over_timeout 0 0 0 0 3600 Seconds D
- --------------------------------------------------------------------------------
- utf8_validation 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_v4_pdts 1 1 1 1 8 PDTs M
- --------------------------------------------------------------------------------
- nfs_v4_vm_bufs 10000 10000 10000 512 50000 Bufs I
- --------------------------------------------------------------------------------
- server_delegation 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- nfs_auto_rbr_trigger 0 0 0 -1 1M MB D
- --------------------------------------------------------------------------------
- client_delegation 1 1 1 0 1 On/Off D
- --------------------------------------------------------------------------------
- n/a means parameter not supported by the current platform or kernel
- Parameter types:
- S = Static: cannot be changed
- D = Dynamic: can be freely changed
- B = Bosboot: can only be changed using bosboot and reboot
- R = Reboot: can only be changed during reboot
- C = Connect: changes are only effective for future socket connections
- M = Mount: changes are only effective for future mountings
- I = Incremental: can only be incremented
- Value conventions:
- K = Kilo: 2^10 G = Giga: 2^30 P = Peta: 2^50
- M = Mega: 2^20 T = Tera: 2^40 E = Exa: 2^60
- [root@aix227:/]#
【实验总结】
1、AIX系统挂载NFS共享,需要设置默认网络参数nfs_use_reserved_ports值修改为1.2、如想实现AIX开机自动挂载NFS,不仅要在/etc/filesystems中设置mount=true,还需要将nfs_use_reserved_ports=1写入nextboot file /etc/tunables/nextboot
3、Linux系统默认nfs_use_reserved_ports参数值为1,AIX系统中此参数默认值为0;故linux系统中只需配置好/etc/fstab即可实现开机自动挂载。
吕星昊
2014.8.12