| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

Linux NFSを構成する

提供: MyMemoWiki
2020年2月15日 (土) 08:37時点におけるPiroto (トーク | 投稿記録)による版
ナビゲーションに移動 検索に移動

Linux NFSを構成する

Linux |


必要なサービス

サービス 内容
portmap RPCのプログラム番号をTCP/IPのポート番号に変換
nfs NFSサーバ
nfslock NFSのファイルロック
rpcidmapd ユーザ名とユーザIDをマッピングするNFSバージョン4のためのデーモン
prcgssd NFSバージョン4クライアント用セキュリティデーモン

サービスの起動

起動確認

  1. # /sbin/service nfs status
  2. rpc.mountd は停止しています
  3. nfsd は停止しています
  4. rpc.rquotad は停止しています
  5. # /sbin/service nfslock status
  6. rpc.statd (pid 1222) を実行中...
  7. # /sbin/service portmap status
  8. portmap (pid 1201) を実行中...
  9. # /sbin/service rpcidmapd status
  10. rpc.idmapd (pid 1255) を実行中...

サーバー起動時に起動されるように

  1. # chkconfig --level 3 nfs on
  2. # chkconfig --level 5 nfs on
  3. # chkconfig --list | grep nfs
  4. nfs 0:off 1:off 2:off 3:on 4:off 5:on 6:off
  5. nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off

サービスを起動

portmap,nfs,nfslockの順に起動する

  1. # /sbin/service nfs start
  2. NFS サービスを起動中: [ OK ]
  3. NFS クォータを起動中: [ OK ]
  4. NFS デーモンを起動中: [ OK ]
  5. NFS mountd を起動中: [ OK ]

ファイアウォールの設定

  • NFS4にチェックし、2049ポートを開放する

0755 nfs 01.jpg

/etx/exports の設定

公開ディレクトリの設定
  • fsid=0オプションの師弟
  1. # vi /etc/exports
  2. /home *(rw,sync,fsid=0)
再読み込みと、公開ディレクトリの確認
  1. # /sbin/service nfs reload
  2. # showmount -e localhost
  3. Export list for localhost:
  4. /home *

マウント

NFSバージョン4
  • nfs4 を指定する
  • /etc/exports で設定した /home ではなく / を指定する
  • NFSバージョン4では、公開されているディレクトリをひとつの仮想ファイルシステムとしてマウントする
  1. # mkdir /krishna_share
  2. # mount -t nfs4 192.168.24.14:/ /krishna_share/

接続できた

  1. [root@ryujyu krishna_share]# ls -l
  2. 合計 8
  3. drwx------ 11 nobody nobody 4096 2009-02-19 00:10 piroot
  4. drwx------ 3 nobody nobody 4096 2008-11-30 15:06 postgres

ユーザ管理

テンプレート:Category 編集中