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

Step-by-step:
  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 10.1.255.254
  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:10.57.18.5  Bcast:10.57.255.255  Mask:255.255.0.0 (from ifconfig command), then my authorised network is: 10.57.0.0/16 (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 10.1.255.254:/mnt/data /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...