Net Storage Project - samuel-richardson/Sam-Tech-Journal GitHub Wiki

Network Storage Project: MooseFS Build, Install, and Test

Description

The network system consists of two CentOS servers with a master CentOS running the MooseFS distributed server.

Networking

  • Centos1-samuel: 10.0.5.200
  • Centos2-samuel: 10.0.5.201
  • Centos3-samuel.samuel.local: 10.0.5.202

On both CentOS 2 and CentOS 3

sudo fdisk /dev/sdb

sudo mkfs.xfs /dev/sdb1

Mount the drive

sudo mkdir /mnt/data1
sudo mfsmount /dev/sdb1 /mnt/data1
chown mfs:mfs /mnt/data1
chmod 770 /mnt/data1

Configure the firewall on all MooseFS nodes

firewall-cmd --zone=public --add-port=24007-24009/tcp --permanent
firewall-cmd --zone=public --add-service=nfs --add-service=samba --add-service=samba-client --permanent
firewall-cmd --zone=public --add-port=111/tcp --add-port=139/tcp --add-port=445/tcp --add-port=965/tcp --add-port=2049/tcp --add-port=38465-38469/tcp --add-port=631/tcp --add-port=111/udp --add-port=963/udp --add-port=49152-49251/tcp --permanent
firewall-cmd --reload

Installation Guide for MooseFS

Add the MooseFS Repository Key

After logging into the master server, add the MooseFS repository key by running the following command as root:

curl "https://repository.moosefs.com/RPM-GPG-KEY-MooseFS" > /etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS

Add YUM Repository Configuration

Choose the appropriate repository entry for your system and add it to your YUM repository configuration which in this case would be EL7:

curl "http://repository.moosefs.com/MooseFS-3-el7.repo" > /etc/yum.repos.d/MooseFS.repo

Update YUM Repository Cache

Update the YUM repository cache by running the following command:

yum makecache

Install MooseFS Components

Install the appropriate MooseFS components needed:

  • For Master Servers:

    yum install moosefs-master moosefs-cgi moosefs-cgiserv moosefs-cli
    
  • For Chunk Servers:

    yum install moosefs-chunkserver
    
  • For Metaloggers:

    yum install moosefs-metalogger
    
  • For Clients:

    yum install moosefs-client
    

Installing Master Server

Use the following command to install the master server:

yum install moosefs-master

Create a sample configuration file:

cd /etc/mfs
cp mfsmaster.cfg.sample mfsmaster
cp mfsexports.cfg.sample mfsexports.cfg

Run the master server:

systemctl start moosefs-master.service

Install Master CGI and CGI on all servers:

yum install moosefs-cgiserv
yum install moosefs-cgi

Run the CGI server

systemctl start moosefs-cgiserv.service

Install chunkservers.

Do the below for each chunk server.

yum install mossefs-chunkserver
vi /etc/mfs/mfschunkserver.cfg # Change name of master to the master node name
echo "/mnt/data1" >> /mnt/mfschunks1
systemctl enable moosefs-chunkserver
systemctl start moosefs-chunkserver

Mounting MooseFS Storage on Client Devices

To mount a file system based on MooseFS for Clients Install FUSE and the MooseFS client library by running the following command:

sudo apt install fuse libfuse2

The MooseFS client can be installed by running the following command:

sudo apt install moosefs-client

Create a directory for the MooseFS file system to be mounted on the client machine by running the following command:

sudo mkdir -p /mnt/mfs

Mount the MooseFS file system by running the following command, specifying the MooseFS master node with the -H option:

sudo mfsmount /mnt/mfs -H centos1-samuel

Verify that the MooseFS file system is mounted by running the following command:

df -h | grep mfs

The output should show information about the MooseFS file system, including its disk usage, mounted at /mnt/mfs. Apache

Setup apache webserver

  • Disable SELinux security in /etc/selinux/config
yum install -y httpd
mkdir /var/www/html/moosefs
mfsmount -H centos1-samuel /var/www/html/moosefs
mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.disabled
systemctl start httpd

Reflection

Overall setting up moosefs and making drives was a straightforward and easy process. It took some time to figure out that I had to disable SELinux to access the moosefs storage for the Apache server. After that had been done, it was smooth sailing. MooseFS has great documentation.