- 論壇徽章:
- 0
|
一般按照如下步驟來配置NFS:
1. Meet pre-NFS configuration requirements on Client and Server
2. Meet NFS software requirements on Client and Server
3. Start Server daemons
4. Start Client daemons
5. Configure NFS on Server
6. Configure NFS on Client
7. Verify Server configuration
8. Verify Client configuration
下面,就詳細(xì)講解以上步驟的具體配置方法。
1. Meet pre-NFS configuration requirements on Client and Server
(1)網(wǎng)卡的狀態(tài)用ioscan -fnC lan查到的為CLAIMED
(2)hostname的配置
(3)IP地址和子網(wǎng)掩碼的配置
(4)route的配置
(5)/etc/hosts文件的配置,將IP地址和hostname對應(yīng)起來
2. Meet NFS software requirements on Client and Server
(1)NFS fileset loaded?
用swlist -l product | grep -i nfs命令來查看相關(guān)的NFS軟件是否安裝了,如果沒有安裝,則使用swinstall命令安裝相應(yīng)的軟件。
(2)Drivers/subsystems in kernel?
可以使用“sam”來進(jìn)行確認(rèn)。
3. Start Server daemons
與NFS server有關(guān)的后臺進(jìn)程有如下幾個:
(1)portmap
Dynamic port assignment daemon used by NFS
(2)nfsd
NFS server data daemons that are usually started 4 at a time
(3)mountd
NFS server that responds to client mount requests
可以按照如下步驟來啟動nfsd和mountd進(jìn)程:
(1)配置/etc/rc.config.d/nfsconf,配置以下幾個信息:
NFS_SERVER=1 #(start nfsd)
NUM_NFSD=4 #(start four of them)
MOUNTD_OPTIONS="" #(no mountd options shown here)
START_MOUNTD=1 #(start mountd)
(2)配置完以上信息以后,重新啟動將激活以上的修改配置
說明:每次系統(tǒng)啟動的時候,portmap會被/sbin/rc2.d/S400nfs.core自動啟動。
4. Start Client daemons
與NFS client有關(guān)的后臺進(jìn)程有如下幾個:
(1)portmap
Dynamic port assignment daemon, used by NFS
(2)bion
NFS client data daemons that are usually started 4 at a time
(3)automount
Optional NFS client. Dynamic mounting/unmounting daemon
可以按照如下方法來啟動biod和automount進(jìn)程:
(1)編輯/etc/rc.config.d/nfsconf, 配置以下幾個信息:
NFS_CLIENT=1 #(start biod)
NUM_NFSIOD=4 #(start four of them)
AUTOMOUNT=1 #(start automount)
AUTO_MASTER="/etc/auto_master" #(automount configuration file)
AUTO_OPTIONS="-f $AUTO_MASTER" #(use the file above)
(2)重新啟動系統(tǒng)以后,以上配置將會生效
5. Configure NFS on Server
(1)確認(rèn)第三步的配置已經(jīng)修改完成,而且相應(yīng)的后臺進(jìn)程已經(jīng)啟動
(2)確認(rèn)要exported to clients的文件系統(tǒng)
(3)確認(rèn)exported to clients的文件系統(tǒng)有權(quán)限被client access
(4)Optional: Determine if there is any logical grouping of clients that could make use of a "netgroup" name. Referring to this "netgroup" name in configuration files would automatically include all clients defined as a part of the "netgroup".
看看如下例子:
#vi /etc/netgroup
examplegroup1 (host_a,,) (host_b,,) (host_x,,)
In this example, referring to the "netgroup" name examplegroup1 in a configuration file automatically means host_a, host_b, and host_x.
(5)Using the decisions made in steps 2 & 3 above, create the export configuration, for example:
#vi /etc/exports
/opt/app1
/usr/share host_c host_d examplegroup1
In this example, we are exporting 2 file systems: /opt/app1 and /usr/share. Since there no hostname after /opt/app1, we are exporting them to everyone (any system can mount or import them). Since we have names following /usr/share, we are restricting the systems who can mount or import /usr/share to host_c, host_d and all clients who are a part of "netgroup"(examplegroup1 (host_a, host_b, and host_x)).
(6)If the NFS server daemons weren't running in step 1, reboot the system. If they are already running, type:
#exportfs -a
NOTE: Any time you modify /etc/exports after this step, use the -u option with exportfs to unexport the filesystem(s) whose entry was modified and then repeat this step.
6. Configure NFS on Client
(1)確認(rèn)第四步的配置已經(jīng)修改完成,而且相應(yīng)的后臺進(jìn)程已經(jīng)啟動,可以用ps -ef命令來查看portmap, nfsd, mountd進(jìn)程
(2)用如下命令來確認(rèn)server的配置:
#exportfs
#showmount -e host_a (在這里,host_a是server的hostname)
#more /etc/netgroup
7. Verify Client configuration
(1)Verify that NFS client daemons are running by typing "ps -ef" and looking for the following processes:
a. portmap
b. biod (Multiple occurences running)
c. automount (optional on-demand mounts only)
(2)See what is currently mounted by typing "mount"
(3)See what is supposed to be mountd by looking at:
a. /etc/fstab
b. /etc/auto_master (optional on-demand mounts only)
本文來自ChinaUnix博客,如果查看原文請點:http://blog.chinaunix.net/u/12718/showart_65702.html |
|