2014年1月28日火曜日

NFS


###############################################################################
●NFSサーバ設定
###############################################################################

●NFS起動
[root@sfzfs62 ~]# service nfs start
NFS サービスを起動中: [ OK ]
NFS クォータを起動中: [ OK ]
NFS デーモンを起動中: [ OK ]
NFS mountd を起動中: [ OK ]

[root@sfzfs62 ES21]# ps -ef | grep nfs
root 31411 2 0 12:05 ? 00:00:00 [nfsd4]
root 31412 2 0 12:05 ? 00:00:00 [nfsd4_callbacks]
root 31413 2 0 12:05 ? 00:00:00 [nfsd]
root 31414 2 0 12:05 ? 00:00:00 [nfsd]
root 31415 2 0 12:05 ? 00:00:00 [nfsd]
root 31416 2 0 12:05 ? 00:00:00 [nfsd]
root 31417 2 0 12:05 ? 00:00:00 [nfsd]
root 31418 2 0 12:05 ? 00:00:00 [nfsd]
root 31419 2 0 12:05 ? 00:00:00 [nfsd]
root 31420 2 0 12:05 ? 00:00:00 [nfsd]
root 32147 28602 0 12:32 pts/0 00:00:00 grep nfs
[root@sfzfs62 ES21]#

●portserve起動
[root@sfzfs62 share]# /etc/rc.d/init.d/portserve start



================================================================================

●共用フォルダ作成
[root@sfzfs62 share]# ls -la /vol/share/
合計 20
drwxr-xr-x 5 root root 4096 1月 27 12:51 2014 .
drwxr-xr-x 3 root root 4096 1月 27 11:42 2014 ..
drwxrwxrwx 2 root root 4096 1月 27 15:02 2014 ES11
drwxr-xr-x 2 root root 4096 1月 27 15:05 2014 ES21
drwxr-xr-x 2 root root 4096 1月 27 12:51 2014 ES31
[root@sfzfs62 share]#

================================================================================
●NFS定義編集
[root@sfzfs62 ES21]# cat /etc/exports
# for test
/opt/admtools/pub *(rw)
/share/ES11 *(rw)
/share/ES21 *(rw)
[root@sfzfs62 ES21]#

[root@sfzfs62 vol]# exportfs -r

================================================================================

●シンボリックリンク作成

[root@sfzfs62 share]# pwd
/share
[root@sfzfs62 share]#

[root@sfzfs62 share]# ln -s /vol/share/ES21 /vol/ES21
[root@sfzfs62 share]# ln -s /vol/share/ES21 /vol/ES21

[root@sfzfs62 vol]# ls -la
合計 16
drwxr-xr-x 4 root root 4096 1月 28 12:46 2014 .
dr-xr-xr-x. 31 root root 4096 1月 28 10:45 2014 ..
lrwxrwxrwx 1 root root 15 1月 28 12:46 2014 ES11 -> /vol/share/ES11
lrwxrwxrwx 1 root root 15 1月 28 12:46 2014 ES21 -> /vol/share/ES21
drwxr-xr-x 4 root root 4096 1月 28 12:18 2014 share
[root@sfzfs62 vol]# pwd
/vol
[root@sfzfs62 vol]#


###############################################################################
●マウント サーバ確認
###############################################################################

[root@sfzfs62 ES21]# showmount -e 172.168.1.41
Export list for 172.168.1.41:
/vol/share/ES11 *
/opt/admtools/pub *
[root@sfzfs62 ES21]#

###############################################################################
●マウント クライアント確認
###############################################################################
----------------------------------------------------------------------------

[root@sfzoa62 /]# mkdir /Connect
[root@sfzoa62 /]# cd Connect
[root@sfzoa62 Connect]# mkdir ES11
[root@sfzoa62 Connect]# mkdir ES21
[root@sfzoa62 Connect]# ls
ES11 ES21
[root@sfzoa62 Connect]# pwd
/Connect


----------------------------------------------------------------------------
[root@sfzoa62 Connect]#
[root@sfzoa62 Connect]# ls -la /Connect
合計 16
drwxr-xr-x. 4 root root 4096 1月 27 15:16 2014 .
dr-xr-xr-x. 32 root root 4096 1月 27 15:16 2014 ..
drwxr-xr-x. 2 root root 4096 1月 27 15:16 2014 ES11
drwxr-xr-x. 2 root root 4096 1月 27 15:16 2014 ES21
[root@sfzoa62 Connect]#
[root@sfzoa62 Connect]# mount -t nfs sfzfs62:/share/ES11 /Connect/ES11
[root@sfzoa62 Connect]# mount -t nfs sfzfs62:/share/ES21 /Connect/ES21
[root@sfzoa62 Connect]#
[root@sfzoa62 Connect]# ls -la /Connect/ES11
合計 12
drwxrwxrwx. 2 root root 4096 1月 27 15:02 2014 .
drwxr-xr-x. 4 root root 4096 1月 27 15:16 2014 ..
-rw-r--r--. 1 root root 40 1月 27 15:02 2014 testfileES11
[root@sfzoa62 Connect]# ls -la /Connect/ES21
合計 12
drwxr-xr-x. 2 root root 4096 1月 27 15:05 2014 .
drwxr-xr-x. 4 root root 4096 1月 27 15:16 2014 ..
-rw-r--r--. 1 root root 32 1月 27 15:05 2014 testfileES21
[root@sfzoa62 Connect]#
----------------------------------------------------------------------------



###############################################################################
●作業用サーバ固有の問題
###############################################################################



/etc/rc.d/init.d/portserv を起動させる。



/etc/idmapd.conf に DomainNameを指定して、デーモン(rpc.imapd)を起動する

----------------------------------------------------------------------------

/etc/rc.d/init.d/portmap