Thursday, October 08, 2015

Building your own NAS/NFS solution with NAS4Free

NAF4Free is a fork of BSD/FreeBSD which is dedicated for network attached storage. The NFS, Network File System, is shared file system protocol allowing client to access file across network. The following is my resume of tutorial given on HPC workshop in ICTP about building own NAS/NSF solution with Nas4free.

NAS4Free Web UI interface

It is assumed you already has master and compute nodes in Virtualbox, so the next task is to mount NAS4Free on master either on compute node.

Mount NAS4Free from Master Node

  1. Download the latest ISO file of NAS4Free
  2. Make new virtual machine on VirtualBox with the following spesification
    • 768 MB of RAM
    • 30 GB HD
    • Network: Bridged-Adapter --> eth0
  3. Boot NAS from VirtualBox, the installation process will start
  4. Reboot after installation
  5. Eject the installation disk and add additional disk to the NAS from the setting, 2 GB is enough for this experiment (see the picture)
  6. Boot again
  7. Configure the NAS, choose option 2 : Configure Network IP address and choose DHCP (for easy, but configure static for the real condition)
  8. Your NAS IP will be shown, for example
  9. Go to the given IP address via web browser, you'll see NAS4Free WebGUI Login
  10. Login to your NAS4Free, the default is 'admin' for user and 'nas4free' for the password, make yourself familiar with the Web UI menu.
  11. Format the disk from Disk menu, use UFS or ZFS
  12. Mount it from Mount menu, choose the disk (adaX, gpt), mount point name: data.
  13. Move to service menu, choose NFS, enable it.
  14. Choose share, and configure it:
  15. The most important thing is to set authorised network, gather information from your host pc to obtain this information. For example if my  inet addr:  Bcast:  Mask: (from ifconfig command), then my authorised network is: (net mask).
  16. Save it and choose apply changes
  17. Choose advance menu and command, use the following command:
  18. killall mountd; mountd -r -n
  19. Now you should mount to your NAS with,
  20. mkdir /mnt/data
    mount /mnt/data
  21. Try to add data, touch /mnt/data/test.txt and check it in your NAS
  22. Alternatively, you can add FTP service and check it via FTP

Adding disk in NAS via VirtualBox Setting

Access NAS via FTP
Configure IP address (for instance you can use DHCP)

Set subnet mask (for instance you can use DHCP)

Set the gateway (for instance you can use DHCP)

Set the DNS (for instance you can use DHCP)

Adding NAS4Free to the cluster
Adding NAS to the cluster via VirtualBox is similar to add it to the master. The different is to set the the network setting to be the same with compute node (internal network:cluster-switch). Give command from master node insert-ethers and choose NAS Appliance. Now you can boot from NAS and configure it as DHCP (option 2), that's all.
Related Posts Plugin for WordPress, Blogger...