1. 程式人生 > >【AIX】AIX 開機自動掛載NFS共享

【AIX】AIX 開機自動掛載NFS共享

【aix】aix 開機自動掛載nfs共享

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。

【實驗過程


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 參數介紹如下
技術分享

  1. -o Tunable[ =NewValue ]

  2. Displays the value or sets Tunable to NewValue. If a tunable needs to be changed (the specified value is different

  3. than current value), and is of type Bosboot or Reboot, or if it is of type Incremental and its current value is bigger

  4. than the specified value, and -r is not used in combination, it will not be changed but a warning displays instead.


  5. When -r is used in combination without a new value, the nextboot value for the Tunable displays. When -p is used in

  6. combination without a NewValue, a value displays only if the current and next boot values for the Tunable are the

  7. same. Otherwise NONE displays as the value.


  8. -p

  9. Makes changes apply to both current and reboot values, when used in combination with -o, -d or -D, that is, it turns

  10. on the updating of the /etc/tunables/nextboot file in addition to the updating of the current value. These

  11. combinations cannot be used on Reboot and Bosboot type parameters because their current value cannot be changed.


  12. When used with -a or -o without specifying a new value, values are displayed only if the current and next boot values

  13. 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
技術分享

  1. [[email protected]:/]#nfso -L

  2. NAME CUR DEF BOOT MIN MAX UNIT TYPE

  3. DEPENDENCIES

  4. --------------------------------------------------------------------------------

  5. portcheck 0 0 0 0 1 On/Off D

  6. --------------------------------------------------------------------------------

  7. udpchecksum 1 1 1 0 1 On/Off D

  8. --------------------------------------------------------------------------------

  9. nfs_socketsize 600000 600000 600000 40000 1280K Bytes D

  10. --------------------------------------------------------------------------------

  11. nfs_tcp_socketsize 600000 600000 600000 40000 1280K Bytes D

  12. --------------------------------------------------------------------------------

  13. nfs_setattr_error 0 0 0 0 1 On/Off D

  14. --------------------------------------------------------------------------------

  15. nfs_gather_threshold 4K 4K 4K 512 8K+1 Bytes D

  16. --------------------------------------------------------------------------------

  17. nfs_repeat_messages 0 0 0 0 1 On/Off D

  18. --------------------------------------------------------------------------------

  19. nfs_udp_duplicate_cache_size

  20. 5000 5000 5000 5000 100000 Req I

  21. --------------------------------------------------------------------------------

  22. nfs_tcp_duplicate_cache_size

  23. 5000 5000 5000 5000 100000 Req I

  24. --------------------------------------------------------------------------------

  25. nfs_server_base_priority 0 0 0 31 125 Pri D

  26. --------------------------------------------------------------------------------

  27. nfs_dynamic_retrans 1 1 1 0 1 On/Off D

  28. --------------------------------------------------------------------------------

  29. nfs_iopace_pages 0 0 0 0 64K-1 Pages D

  30. --------------------------------------------------------------------------------

  31. nfs_max_connections 0 0 0 0 10000 Number D

  32. --------------------------------------------------------------------------------

  33. nfs_max_threads 3891 3891 3891 5 3891 Threads D

  34. --------------------------------------------------------------------------------

  35. nfs_use_reserved_ports 1 0 1 0 1 On/Off D

  36. --------------------------------------------------------------------------------

  37. nfs_device_specific_bufs 1 1 1 0 1 On/Off D

  38. --------------------------------------------------------------------------------

  39. nfs_server_clread 1 1 1 0 1 On/Off D

  40. --------------------------------------------------------------------------------

  41. nfs_rfc1323 0 0 0 0 1 On/Off D

  42. --------------------------------------------------------------------------------

  43. nfs_max_write_size 32K 32K 32K 512 64K Bytes D

  44. --------------------------------------------------------------------------------

  45. nfs_max_read_size 32K 32K 32K 512 64K Bytes D

  46. --------------------------------------------------------------------------------

  47. nfs_allow_all_signals 0 0 0 0 1 On/Off D

  48. --------------------------------------------------------------------------------

  49. nfs_v2_pdts 1 1 1 1 8 PDTs M

  50. --------------------------------------------------------------------------------

  51. nfs_v3_pdts 1 1 1 1 8 PDTs M

  52. --------------------------------------------------------------------------------

  53. nfs_v2_vm_bufs 10000 10000 10000 512 50000 Bufs I

  54. --------------------------------------------------------------------------------

  55. nfs_v3_vm_bufs 10000 10000 10000 512 50000 Bufs I

  56. --------------------------------------------------------------------------------

  57. nfs_securenfs_authtimeout 0 0 0 0 60 Seconds D

  58. --------------------------------------------------------------------------------

  59. nfs_v3_server_readdirplus 1 1 1 0 1 On/Off D

  60. --------------------------------------------------------------------------------

  61. lockd_debug_level 0 0 0 0 10 Level D

  62. --------------------------------------------------------------------------------

  63. statd_debug_level 0 0 0 0 10 Level D

  64. --------------------------------------------------------------------------------

  65. statd_max_threads 50 50 50 1 1000 Threads D

  66. --------------------------------------------------------------------------------

  67. nfs_v4_fail_over_timeout 0 0 0 0 3600 Seconds D

  68. --------------------------------------------------------------------------------

  69. utf8_validation 1 1 1 0 1 On/Off D

  70. --------------------------------------------------------------------------------

  71. nfs_v4_pdts 1 1 1 1 8 PDTs M

  72. --------------------------------------------------------------------------------

  73. nfs_v4_vm_bufs 10000 10000 10000 512 50000 Bufs I

  74. --------------------------------------------------------------------------------

  75. server_delegation 1 1 1 0 1 On/Off D

  76. --------------------------------------------------------------------------------

  77. nfs_auto_rbr_trigger 0 0 0 -1 1M MB D

  78. --------------------------------------------------------------------------------

  79. client_delegation 1 1 1 0 1 On/Off D

  80. --------------------------------------------------------------------------------


  81. n/a means parameter not supported by the current platform or kernel


  82. Parameter types:

  83. S = Static: cannot be changed

  84. D = Dynamic: can be freely changed

  85. B = Bosboot: can only be changed using bosboot and reboot

  86. R = Reboot: can only be changed during reboot

  87. C = Connect: changes are only effective for future socket connections

  88. M = Mount: changes are only effective for future mountings

  89. I = Incremental: can only be incremented


  90. Value conventions:

  91. K = Kilo: 2^10 G = Giga: 2^30 P = Peta: 2^50

  92. M = Mega: 2^20 T = Tera: 2^40 E = Exa: 2^60

  93. [[email protected]:/]#



【實驗總結

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即可實現開機自動掛載。


本文出自 “愛生活的小白” 博客,請務必保留此出處http://sf1314.blog.51cto.com/13295031/1971641

【AIX】AIX 開機自動掛載NFS共享