Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script for provisioning moosefs chunk server on redhat/amazon based distros
#!/bin/bash
ip=$1
size=$2
device=$3
# Install certificates and Repository
curl "https://ppa.moosefs.com/RPM-GPG-KEY-MooseFS" > /etc/pki/rpm-gpg/RPM-GPG-KEY-MooseFS
curl "http://ppa.moosefs.com/MooseFS-3-el7.repo" > /etc/yum.repos.d/MooseFS.repo
# Install moosefs-chunkserver, fuse and others
yum install -y gnupg2 ca-certificates e2fsprogs xfsprogs moosefs-chunkserver
# Provision and mount volume
mkfs -t xfs $device
mkdir -p /mnt/xvdh
mount $device /mnt/xvdh
# Configure moosefs chunk server
chown -R mfs:mfs /mnt/xvdh
echo "/mnt/xvdh $sizeGiB" > /etc/mfs/mfshdd.cfg
# Add master
echo "MASTER_HOST = $ip" > /etc/mfs/mfschunkserver.cfg
# Start the chunkserver service
/usr/sbin/mfschunkserver start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment