Skip to content

Instantly share code, notes, and snippets.

@maniankara
Last active September 7, 2018 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maniankara/d4cd6ea36496af6e57b3333c1e882828 to your computer and use it in GitHub Desktop.
Save maniankara/d4cd6ea36496af6e57b3333c1e882828 to your computer and use it in GitHub Desktop.
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