scream314 / terraform-module-mongo

A terraform module for creating a self-healing mongo cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-module-mongo

A terraform module for creating a mongo replica set that is kind of self healing. If an individual member dies, the auto scale group should relaunch it and it should rejoin automagically.

Requirements

  • base ami (ubuntu, untested with anything else)
    • mongodb installed and configured
    • EBS volume available at /dev/xvdg
    • name prefixed with mongo-

Initial Setup

  1. terraform apply
  2. log into created mongo hosts via ssh
  3. stop mongo (probably not running properly, because an admin user doesn't exist yet)
  4. create mongo admin user
  5. restart mongo on all hosts
  6. on a single host, create a replica set, using the DNS name created in route53 instead of the hostname of the box
  7. add the other instances to the replica set using the DNS names
  8. your replica set should be up

About

A terraform module for creating a self-healing mongo cluster

License:MIT License


Languages

Language:HCL 100.0%