Debian(squeeze)でNFSサーバ
ESXiホストにストレージとして追加するために、Debian 6.0.5(squeeze)で
NFSサーバを立ち上げます。
1.portmapとNFSサーバがインストールされているか確認する。
root@debian:/etc# aptitude show portmap
Package: portmap
State: installed
Automatically installed: no
Version: 6.0.0-2
Priority: standard
Section: net
Maintainer: Anibal Monsalve Salazar <anibal@debian.org>
Uncompressed Size: 164 k
Depends: libc6 (>= 2.7), libwrap0 (>= 7.6-4~), debconf (>= 0.5) | debconf-2.0, lsb-base
(>= 3.2-14)
Conflicts: sysv-rc (< 2.86.ds1-59)
Replaces: netbase (< 4.00)
Provided by: rpcbind
Description: RPC port mapper
Portmap is a server that converts RPC (Remote Procedure Call) program numbers into DARPA
protocol port numbers. It must be running in order to make RPC calls.
Services that use RPC include NFS and NIS.
Homepage: http://neil.brown.name/portmap/
root@debian:/etc#
root@debian:/etc# aptitude show nfs-kernel-server
Package: nfs-kernel-server
State: not installed
Version: 1:1.2.2-4squeeze2
Priority: optional
Section: net
Maintainer: Debian kernel team <debian-kernel@lists.debian.org>
Uncompressed Size: 385 k
Depends: libblkid1 (>= 2.16), libc6 (>= 2.4), libcomerr2 (>= 1.01), libgssapi-krb5-2 (>=
1.6.dfsg.2), libgssglue1, libk5crypto3 (>= 1.6.dfsg.2), libkrb5-3 (>=
1.6.dfsg.2), libnfsidmap2, librpcsecgss3, libwrap0 (>= 7.6-4~), nfs-common (=
1:1.2.2-4squeeze2), ucf, lsb-base (>= 1.3-9ubuntu3)
Conflicts: knfs, nfs-server
Replaces: knfs, nfs-server
Provides: knfs, nfs-server
Description: support for NFS kernel server
The NFS kernel server is currently the recommended NFS server for use with Linux,
featuring features such as NFSv3 and NFSv4, Kerberos support via GSS, and much more. It
is also significantly faster and usually more reliable than the user-space NFS servers
(from the unfs3 and nfs-user-server packages). However, it is more difficult to debug
than the user-space servers, and has a slightly different feature set.
This package contains the user-space support needed to use the NFS kernel server. Most
administrators wishing to set up an NFS server would want to install this package.
Homepage: http://nfs.sourceforge.net/
root@debian:/etc#
Portmapはインストールされているが、NFSサーバは
インストールされていませんでした。
2.NFSサーバのインストール
root@debian:/etc# aptitude install nfs-kernel-server
The following NEW packages will be installed:
nfs-kernel-server
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 158 kB of archives. After unpacking 385 kB will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main nfs-kernel-server armel 1:1.2.2-4squeeze2 [158 kB]
Fetched 158 kB in 0s (340 kB/s)
Selecting previously deselected package nfs-kernel-server.
(Reading database ... 26320 files and directories currently installed.)
Unpacking nfs-kernel-server (from .../nfs-kernel-server_1%3a1.2.2-4squeeze2_armel.deb) ...
Processing triggers for man-db ...
Setting up nfs-kernel-server (1:1.2.2-4squeeze2) ...
Creating config file /etc/exports with new version
Creating config file /etc/default/nfs-kernel-server with new version
insserv: warning: script 'K01httpd' missing LSB tags and overrides
insserv: warning: script 'httpd' missing LSB tags and overrides
Starting NFS common utilities: statd.
Exporting directories for NFS kernel daemon....
Starting NFS kernel daemon: nfsd mountd.
root@debian:/etc#
3.サービス状態確認
root@debian:/etc# /etc/init.d/nfs-kernel-server status
nfsd running
root@debian:/etc#
root@debian:/etc# /etc/init.d/portmap status
portmap is running.
root@debian:/etc#
4.公開ディレクトリの作成をします。
root@debian:/etc# mkdir /mnt/export
5.設定ファイルの編集
公開ディレクトリを設定します。
root@debian:/etc# cp /etc/exports /etc/exports.20120707
root@debian:/etc# vi /etc/exports
-------------------------------------------------
# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/mnt/export 192.168.0.0/24(rw,sync,no_root_squash,no_subtree_check)
-------------------------------------------------
※設定内容の詳細は以下を確認
http://linuxjm.sourceforge.jp/html/nfs-utils/man5/exports.5.html
6.NFSサーバを再起動します。
root@debian:/etc# /etc/init.d/nfs-kernel-server restart
Stopping NFS kernel daemon: mountd nfsd.
Unexporting directories for NFS kernel daemon....
Exporting directories for NFS kernel daemon....
Starting NFS kernel daemon: nfsd mountd.
root@debian:/etc#
root@debian:/etc# exportfs
/mnt/export 192.168.0.0/24
root@debian:/etc#
以上
最近のコメント