Pages

Search result

Sabtu, 20 November 2010

Install and configure NAS using NFS on CentOS

This article described how to install and configure CentOS as NAS (Network Attach Storage using NFS (Network File System), my CentOS box already running under 5.5 final (update) version with minimum installation mode.  Please see the following step:


Update your OS
$ sudo yum update -y

Installing NFS utility:

$ sudo yum install nfs*

Create a directory that use by client, in my centos box I've created "/data" as clients storages.

$ sudo mkdir /data/node1
$ sudo chmod -R 777 /data/node1

Create user/client privileges by editing /etc/export with the parameter "/path-server      ip-network-allowed(privileges)", like this:

$ sudo vi /etc/export
/data/node2       10.10.1.10(rw,sync,no_subtree_check)

You need to export all configuration using:

$ sudo /usr/sbin/exportfs -avr
$ sudo /etc/init.d/portmap restart
$ sudo /etc/init.d/nfs restart
$ sudo /sbin/chkconfig --level 35 portmap on
$ sudo /sbin/chkconfig --level 35 nfs on

Now we can setup security feature by editing:"hosts.allow", like this:

$ sudo vi /etc/hosts.allow
portmap: 10.10.1.10, 192.168.10.2

Next install nfs utility on client and configure:

$ sudo yum install nfs
$ sudo yum install portmap
$ sudo /etc/init.d/portmap start
$ sudo /sbin/chkcongfig --level 35 portmap on

Check server configuration using showmount:

$ sudo showmount -e nas-server
Export list for nas-server:
/data/node1    10.10.1.10

Create local directory in client, and mount local directory to nas:

$ sudo mkdir /mynas
$ sudo mount nas-server:/data/node1 /mynas
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              9.5G  691M  8.3G   8% /
/dev/md7              292G   86G  192G  31% /home
/dev/md6               95G   32G   59G  35% /backup
/dev/md5              2.0G  170M  1.7G  10% /tmp
/dev/md3               38G  3.6G   33G  10% /var
/dev/md2               15G  3.9G  9.7G  29% /usr
/dev/md0              243M   24M  207M  11% /boot
tmpfs                 2.0G     0  2.0G   0% /dev/shm
nas-server:/data/node1      857G  696G  117G  86% /mynas

Done, hope this useful :D

Tidak ada komentar:

Posting Komentar