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-09
NFS伺服器 作業系統:RHEL 5.4
進行oracle資料庫集中備份時,Backup Server (rhel)連接配接到磁盤陣列。然後通過NFS共享存儲空間供各個資料庫伺服器存儲備份檔案。
各資料庫伺服器(AIX系統)作為用戶端挂載對應NFS共享,即可備份時通過Backup Server将備份檔案存儲在陣列上。
與Linux系統不同,當AIX作為NFS用戶端,挂載NFS共享時,需調整AIX預設網絡參數。
若想實作開機啟動,必須将網絡參數值寫入nextboot file。
showmount -e rhel152 | grep aix227
共享存儲的位置為 rhel152:/backup/cuug02/storage03
vi /etc/filesystems
mount=true 即開機自動挂載
mount /backup
咦?linux系統中隻要做類似配置,即可成功挂載,到了AIX系統怎麼就不行了呢?
難道是編輯的配置有問題?
為驗證NFS的配置資訊,删除/etc/filesystems中所添加資訊,使用smit nfs 重新進行配置
下圖陪配置資訊中
/etc/filesystems entry will mount the directory on system restart 選項 設定為 yes
即 開機自動挂載
配置完畢後 回車 顯示 failed
仍然報錯,Not owner
檢視相關資料,出現此報錯資訊,需要調整AIX預設網絡參數
nfso -o nfs_use_reserved_ports=1
調整完畢後再次手動挂載無報錯資訊
df -g檢視,已成功挂載NFS伺服器共享目錄到本地檔案系統
上面手動挂載成功後,還需重新開機AIX系統看是否能夠實作開機自動挂載
shutdown -Fr 重新開機AIX系統
重新開機後檢視NFS未成功挂載,手工mount失敗,依然報相同錯
smit nfs檢視相關資訊,開機挂載選項的确是yes
從上面報錯資訊看出,還是網絡參數需要調整。
那如果每次挂載前都需要調整,就無法實作開機自動挂載了。
能不能将此參數設定為永久生效呢?
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後的值。
nfso -p -o nfs_use_reserved_ports=1
提示資訊顯示寫入了nextboot file
檢視/etc/tunables/nextboot 新增加我們剛剛設定的參數
手動mount,挂載NFS成功不報錯
shutdonw -Fr 再次重新開機AIX系統查驗
自動挂載NFS成功,實作了AIX系統開機自動挂載NFS
檢視/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
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即可實作開機自動挂載。
本文轉自 Mr_sheng 51CTO部落格,原文連結:http://blog.51cto.com/sf1314/1971641