Mongo MMS API agent for ruby with basic cli client

During last two days I have developed very minimalistic the Mongo MMS API ruby client which is easily extendable as mms-api gem (source code on github so please contribute).

The client is used by me to extend Pulsar (capistrano) tasks with ability to orchestrate the Database Restore from MMS Snapshot for fully sharded and replicated cluster.

Example pulsar task using mms-api gem:

  • MMS: get list of snapshots
  • Pulsar: select snapshot ID
  • MMS: create restore job for snapshot ID
  • SSH: login to one of cluster machines
  • SSH: download config-server, replicas using links returned by new restore-job
  • SSH: stop all cluster members: routers, replicas, configs, mms agents
  • SSH: distribute downloaded data to all members by role
  • SSH: restore data to mongo data directory
  • SSH: start all cluster members: configs, replicas, mms agents, routers
  • Pulsar/MMS: verify cluster health using at least this criteria
  • Done!

Using mms-api gem you can easily extend your pulsar task with e.g. health tests (see code example)

Resource summary: