AIX 上使用NFS實(shí)現(xiàn)AIX之間文件網(wǎng)絡(luò)共享
十余年的澠池網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開(kāi)發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。營(yíng)銷(xiāo)型網(wǎng)站的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整澠池建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)從事“澠池網(wǎng)站設(shè)計(jì)”,“澠池網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
AIX 可以使用NFS在AIX之間實(shí)現(xiàn)類(lèi)似window共享文件夾功能,在多臺(tái)aix上安裝系統(tǒng)補(bǔ)丁的時(shí)候比較有用只需要在一臺(tái)服務(wù)器上FTP上傳,其他AIX通過(guò)共享訪問(wèn)(注意不要多臺(tái)一起訪問(wèn)可能會(huì)由于I/O繁忙帶有問(wèn)題)
注意:
1. 多臺(tái)AIX之前在同一個(gè)局域網(wǎng)子網(wǎng)段中沒(méi)有問(wèn)題,若跨網(wǎng)段請(qǐng)確認(rèn)網(wǎng)絡(luò)開(kāi)通NFS端口
2. 下面我都是用root賬戶登錄操作
3. 要在A,B兩端的/etc/hosts里互相都加上彼此的IP地址和hostname(若不用DNS都通過(guò)hosts表里name
l 第一部分在AIX服務(wù)器A 上面建里要通過(guò)NFS共享的目錄比如:根目錄下/test目錄
# ls -l total 8 -rw-r----- 1 root system 543 Jul 24 03:39 temp.txt |
/test目錄中存放一個(gè)文件temp.txt內(nèi)容如下,后面可以用這個(gè)驗(yàn)證共享成功
# cat temp.txt SBMJOB CMD(STROBJCVN LIB(*ALLUSR)) LOG(4 0 *SECLVL)
S6564E5B 定時(shí)任務(wù) DAILY4 HOLD
磁帶機(jī)中磁帶 卷標(biāo) 001176推入磁帶機(jī)TAP07
Opt Queue Manager Port HHT 1417
MQM HHT
Opt Queue Manager Port HHT 1414 HHT 1417 |
A機(jī)器上運(yùn)行# smit nfs
先選擇Network File System (NFS)
NFS
Move cursor to desired item and press Enter.
Configure TCP/IP (If Not Already Configured) Network File System (NFS) Network Information Service (NIS) Configure Secure NFS & NIS
|
再選擇Add a Directory to Exports List(先Change / Show Attributes of an Exported Directory確認(rèn)目錄之前沒(méi)有被Exported
Network File System (NFS)
Move cursor to desired item and press Enter.
Configure NFS on This System Add a Directory to Exports List Change / Show Attributes of an Exported Directory Remove a Directory from Exports List Add a File System for Mounting Change / Show Attributes of an NFS File System Remove an NFS File System Flush NFS V4 Translation Cache Add NFSv4 File System FSID Options Change / Show NFSv4 File System FSID Options Reset NFSv4 File System FSID Options |
下面畫(huà)面中* Pathname of directory to export 輸入導(dǎo)出目錄路徑和名稱(chēng) [/test]
Add a Directory to Exports List
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[TOP] [Entry Fields] * Pathname of directory to export [/test] Anonymous UID [-2] Public filesystem? no * Export directory now, system restart or both both []
|
運(yùn)行完成之后如下提示
COMMAND STATUS
Command: running stdout: yes stderr: no
Before command completion, additional instructions may appear below.
0513-059 The nfsd Subsystem has been started. Subsystem PID is 5505044. 0513-059 The rpc.mountd Subsystem has been started. Subsystem PID is 7077952. |
l 第二部分在另外一臺(tái)服務(wù)器B上
運(yùn)行smitty nfs選擇Network File System (NFS)
NFS
Move cursor to desired item and press Enter.
Configure TCP/IP (If Not Already Configured) Network File System (NFS) Network Information Service (NIS) Configure Secure NFS & NIS |
B機(jī)器上選擇Add a File System for Mounting
Network File System (NFS)
Move cursor to desired item and press Enter.
Configure NFS on This System Add a Directory to Exports List Change / Show Attributes of an Exported Directory Remove a Directory from Exports List Add a File System for Mounting Change / Show Attributes of an NFS File System Remove an NFS File System Flush NFS V4 Translation Cache Add NFSv4 File System FSID Options Change / Show NFSv4 File System FSID Options Reset NFSv4 File System FSID Options |
Pathname of mount point 填B機(jī)上mount點(diǎn)
Pathname of remote directory填A(yù)機(jī)上路徑
Host where remote directory resides填A(yù)機(jī)主機(jī)名(在A機(jī)器上運(yùn)行hostname獲得)
Add a File System for Mounting
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[TOP] [Entry Fields] * Pathname of mount point [/tmp/test/] * Pathname of remote directory [/test] * Host where remote directory resides [svr05427] Mount type name [] * Security method [sys] * Mount now, add entry to /etc/filesystems or both? now * /etc/filesystems entry will mount the directory no on system restart.
|
注意: 要在A,B兩端的/etc/hosts里互相都加上彼此的IP地址和hostname
若提示not in hosts database 需要修改B機(jī)器上/etc/hosts文件增加A服務(wù)器的IP地址和hostname
COMMAND STATUS
Command: failed stdout: yes stderr: no
Before command completion, additional instructions may appear below.
mount: 1831-009 svr05427 not in hosts database mount: 1831- 008 giving up on: svr05427:/test A route to the remote host is not available.
|
若有如下錯(cuò)誤可能網(wǎng)絡(luò)上沒(méi)有開(kāi)放NFS需要的端口
COMMAND STATUS
Command: failed stdout: yes stderr: no
Before command completion, additional instructions may appear below.
nfsmnthelp: 1831-019 svr05427: System call error number -1.
mount: 1831- 008 giving up on: svr05427:/test System call error number -1. |
成功之后可以在B機(jī)上smit mount中 List all能看到mount上文件驗(yàn)證,并訪問(wèn)共享文件內(nèi)容確認(rèn)可以訪問(wèn)
l 卸載
取消在B機(jī)上可以用smit umount指定上面B機(jī)上mount點(diǎn)可以在B機(jī)器上取消該NFS
在A機(jī)器上卸載,smit nfs選擇Remove a Directory from Exports List 輸入路徑
Network File System (NFS)
Move cursor to desired item and press Enter.
Configure NFS on This System Add a Directory to Exports List Change / Show Attributes of an Exported Directory Remove a Directory from Exports List Add a File System for Mounting Change / Show Attributes of an NFS File System Remove an NFS File System Flush NFS V4 Translation Cache Add NFSv4 File System FSID Options Change / Show NFSv4 File System FSID Options Reset NFSv4 File System FSID Options |
l 權(quán)限
我兩臺(tái)機(jī)器都是用root賬戶訪問(wèn)權(quán)限兩臺(tái)都是如下一樣
# ls -l total 8 -rw-r----- 1 root system 543 Jul 24 06:10 temp.txt |
l 附錄:
l windows端也能訪問(wèn)AIX NFS ,也有建議window訪問(wèn)aix文件系統(tǒng)SAMBA比NFS好
比如:http://www.chinaunix.net/jh/9/503373.html
經(jīng)常碰到一些客戶需要將PC Server的數(shù)據(jù)定期放到運(yùn)行AIX操作系統(tǒng)的6000小機(jī)的 磁帶機(jī)上備份,做了幾個(gè)這樣的案例 Share一下:)
1、下載SFU
SFU是微軟的一款與UNIX系統(tǒng)進(jìn)行文件共享的軟件 100M左右??稍赪indows端模擬NFS Server 或者使 Windows成為NFS Client。他是免費(fèi)的。下載時(shí)需要.net帳戶(msn的就行)
2、在Windows端安裝SFU軟件。選擇作為NFS Client。安裝時(shí)間較長(zhǎng)。安裝結(jié)束后可以在網(wǎng)上鄰居中發(fā)現(xiàn)新增加了一個(gè)叫做SFU的 工作組(好像是這個(gè)名字)
在上面點(diǎn)擊右鍵選擇添加,將6000的IP地址加入。在6000一端開(kāi)啟NFS服務(wù)。刷新后就可看到該服務(wù)器了
3、身分認(rèn)證:在兩端建立相同帳號(hào),需要在6000上編輯/etc/hosts文件。將需要訪問(wèn)NFS路徑的服務(wù)器IP地址與機(jī)器名稱(chēng)加入。這是 在PC Server端就可以訪問(wèn)該共享文件夾了。在上面還可進(jìn)行權(quán)限的管理 有興趣的自己實(shí)驗(yàn)吧。