Get Virtualizor

Create Shared Storage

Under Development

Overview

In this guide you will learn to share storage using different protocol.

Share Storage using NFS

NFS is a Distributed File system protocol, it is used to share server's storage remotely to other server. On the client server, we add that NFS storage to read, write files from the shared storage.

Configure NFS on server

1. Install Packages

In order to use NFS on server we need to install nfs-kernel-server on ubuntu or nfs-utils on centos.

# FOR CENTOS

yum install -y nfs-utils


# FOR UBUNTU

apt-get install -y nfs-kernel-server
2. Create NFS Export Directory

Create a directory that needs to be shared among the client servers.

# mkdir  /xyz
3. Change Permissions of Directory

We change the permission of the directory so that the client server can easily access the directory without ant restriction.

chown -R nobody:nogroup /xyz

chmod 777 /xyz
4. Allow Client IPs to access the NFS Storage

In order to access the NFS storage you need to add Client Ips in /etc/exports.

vi /etc/exports

Add IPs that you want to allow access.

/xyz  CLIENT_IP(rw,sync,no_root_squash)
5. Export the NFS directory

In order to access the NFS storage you need to add Client Ips in /etc/exports.

exportfs -a

Configure NFS Client on server

1. Install the NFS Common package on Client Server

In order to access nfs storage on Client System you need to install some packages on the client server. Below commands installs them.

# FOR CENTOS

yum install -y nfs-utils nfs4-acl-tools


# FOR UBUNTU

apt-get install -y nfs-common
2. Create a mount point on NFS Client Server

Create a directory on the Client system to mount the NFS share.

mkdir -p /nfs_share
3. Mount nfs share on Client System

You can mount NFS share using the mount command, but the NFS storage will not be mounted on reboot. To mount the NFS share on boot add an entry in /etc/fstab.

mount -t nfs Client_ip:/xyz /nfs_share
#vi /etc/fstab

Client_ip:/xyz/data /nfs_share nfs defaults 0 0

In order to mount NFS as NFSv3 version you need to added vers parameter to the to the commands.

mount -t nfs -o vers=3 Client_ip:/xyz /nfs_share
#vi /etc/fstab


Client_ip:/xyz/data /nfs_share nfs defaults,vers=3 0 0

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list