MooseFS Docker Cluster

This commit is contained in:
Karol Majek
2018-08-23 11:50:36 +02:00
commit 313bde27e9
19 changed files with 753 additions and 0 deletions

23
moosefs-master/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
FROM ubuntu:14.04
# Install wget, lsb-release and curl
RUN apt-get update && apt-get install -y wget lsb-release curl
# Add key
RUN wget -O - http://ppa.moosefs.com/moosefs.key | apt-key add -
RUN . /etc/lsb-release && echo "deb http://ppa.moosefs.com/moosefs-3/apt/ubuntu/$DISTRIB_CODENAME $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/moosefs.list
# Install MooseFS master and CGI
RUN apt-get update && apt-get install -y moosefs-master moosefs-cgi moosefs-cgiserv
#Enable CGI Serv
ADD moosefs-cgiserv /etc/default/moosefs-cgiserv
# Expose ports
EXPOSE 9420 9421 9422 9423 9424 9425
# Add and run start script
ADD start.sh /home/start.sh
RUN chown root:root /home/start.sh
RUN chmod 700 /home/start.sh
CMD ["/home/start.sh", "-d"]

View File

@@ -0,0 +1,12 @@
# /etc/default/moosefs-cgiserv
# Start mfscgiserv from init.d script on boot.
# Only allowed values are "true" and "false".
# Undefined values default to "false".
MFSCGISERV_ENABLE=true
# user and group used to run mfscgiserv
MFSCGISERV_USER=nobody
MFSCGISERV_GROUP=nogroup
DAEMON_OPTS=""

19
moosefs-master/start.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
cp /etc/mfs/mfsmaster.cfg.sample /etc/mfs/mfsmaster.cfg
cp /etc/mfs/mfsexports.cfg.sample /etc/mfs/mfsexports.cfg
# Add hostname to hosts
ifconfig eth0 | awk '/inet addr/{printf substr($2,6)}' >> /etc/hosts
echo " mfsmaster" >> /etc/hosts
ifconfig eth0 | awk '/inet addr/{print substr($2,6)}'
mfsmaster start -a
service moosefs-cgiserv start
if [[ $1 == "-d" ]]; then
while true; do sleep 1000; done
fi
if [[ $1 == "-bash" ]]; then
/bin/bash
fi