qr

fistfulofbytes

Mongodb Automation Agent with Fleet

permalink: ffbyt.es/jfam

16 February 2015

Index

MMS+Coreos

Configure the config file with the keys provided by mms, upload the binary and local.config somewhere your servers can reach. Configure the mms.service file with the address of where you uploaded those and simply `fleetctl start mms.service`. All your machines that have fleet running should now appear in MMS console.

Config

#
# REQUIRED
# Enter your Group ID - It can be found at https://mms.mongodb.com/settings
#
mmsGroupId={your group id}


#
# REQUIRED
# Enter your API key - It can be found at https://mms.mongodb.com/settings
#
mmsApiKey={your api key}


#
# Base url of the MMS web server.
#
mmsBaseUrl=https://mms.mongodb.com

#
# Path to log file
#
logFile=/var/log/mongodb-mms-automation/automation-agent.log

#
# Path to backup cluster config to
#
mmsConfigBackup=/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json

#
# Lowest log level to log.  Can be (in order): DEBUG, ROUTINE, INFO, WARN, ERROR, DOOM
#
logLevel=INFO

#
# Maximum number of rotated log files
#
maxLogFiles=10

#
# Maximum size in bytes of a log file (before rotating)
#
maxLogFileSize=268435456

#
# URL to proxy all HTTP requests through
#
#httpProxy=

Script

[Unit]
Description=MongoAutomationAgent

[Service]
ExecStartPre=/usr/bin/wget {yourdomain}/local.config
ExecStartPre=/usr/bin/wget -N -P {yourdomain}/mongodb-mms-automation-agent
ExecStartPre=/usr/bin/chmod +x /opt/bin/mongodb-mms-automation-agent
ExecStartPre=/usr/bin/mkdir -p /var/lib/mongodb-mms-automation
ExecStartPre=/usr/bin/mkdir -p /var/log/mongodb-mms-automation
ExecStartPre=/usr/bin/mkdir -p /data
ExecStart=/opt/bin/mongodb-mms-automation-agent --config=local.config >> /var/log/mongodb-mms-automation/automation-agent.log 2>&1
Restart=always
RestartSec=10

[X-Fleet]
Global=true

By Sevki