Mup Troubleshooting

This is a cheatsheet on troubleshooting Mup, the Meteor deploy tool.

Since 2015, Mup started using Docker for deployments.

Docker Commands

command use
sudo docker ps show running containers

Other Useful Commands

command use
htop Show resource use – sortable

Server Directories & File Locations

Applications are stored under /opt.

Project Scripts & Config Files

These are the key scripts used by the Mup project:

meteor-deploy-check.sh Check if deployment was successful
docker-setup.sh Installs Docker if it isn't already installed
meteor-setup.sh Create /opt/meteor and subdirs
meteor-start.sh cd /opt/<AppName>; config/start.sh
meteor-stop.sh sudo docker rm -f <AppName>; docker rm -f <AppName>-frontend

Server Commands Used by Scripts

Here’s an example

function command
start app /opt/<appName>/config/start.sh
show logs docker logs –tail=50 /opt/

Docker Containers

Runtime Name Docker Image
mongodb mongo:latest
lt;appNamegt; abernix/meteord:base
lt;appNamegt;-frontend abernix/meteord:base

Startup Script

Here’s an example startup script from an app called AppName:

#!/bin/bash

APPNAME=AppName
APP_PATH=/opt/$APPNAME
BUNDLE_PATH=$APP_PATH/current
ENV_FILE=$APP_PATH/config/env.list
PORT=8008

# Remove previous version of the app, if exists
docker rm -f $APPNAME

# Remove frontend container if exists
docker rm -f $APPNAME-frontend

# We don't need to fail the deployment because of a docker hub downtime
set +e
docker pull abernix/meteord:base
set -e

docker run \
  -d \
  --restart=always \
  --publish=$PORT:80 \
  --volume=$BUNDLE_PATH:/bundle \
  --hostname="$HOSTNAME-$APPNAME" \
  --env-file=$ENV_FILE \
  --link=mongodb:mongodb --env=MONGO_URL=mongodb://mongodb:27017/$APPNAME \
  \
  --log-opt max-size=100m --log-opt max-file=10 \
  \
  \
  --name=$APPNAME \
  abernix/meteord:base

Leave a Reply

Your email address will not be published. Required fields are marked *