Giter Club home page Giter Club logo

opsworks-mongodb-example's Introduction

opsworks-mongodb-example

Using the mongodb community cookbook to set up a MongoDB replicat set within an AWS OpsWorks custom layer.

Inspired by the blog post Deploying MongoDB with OpsWorks.

  1. In AWS OpsWorks create a stack with the following properties:
{
  "mongodb": {
    "app_name": "todo_express",
    "config": {
      "replSet": "todors"
    }
  },
  "opsworks": {
    "data_bags": {
      "mongodb": {
        "mongodb1": {
          "mongodb": {
            "config": {
              "port": 27017
            },
            "replica_build_indexes": true,
            "replica_slave_delay": 0,
            "replica_priority": 1,
            "replica_tags": {},
            "replica_votes": 1
          }
        },
        "mongodb2": {
          "mongodb": {
            "config": {
              "port": 27017
            },
            "replica_build_indexes": true,
            "replica_slave_delay": 0,
            "replica_priority": 1,
            "replica_tags": {},
            "replica_votes": 1
          }
        },
        "mongodb3": {
          "mongodb": {
            "config": {
              "port": 27017
            },
            "replica_build_indexes": true,
            "replica_slave_delay": 0,
            "replica_priority": 1,
            "replica_tags": {},
            "replica_votes": 1
          }
        },
...
      }
    }
  }
}
  1. Add a custom layer, name it mongodb and add the following Custom Chef Recipes:
  • Setup: server
  • Configure: mongodb::replicaset
  1. Add a Node.js App Server layer and add client::deploy as Custom Chef Recipe for the Deploy lifecycle event.
  2. Add an app with the following properties:

Using Chef 11.10 is required, as Berkshelf, search and data bags are used:

  • Berkshelf is used to load the mongodb community cookbook.
  • Using search to find all online nodes within the mongodb layer.
  • Data bags to store required properties for the found nodes - as there's no Chef Server as central storage of such properties, a data bag is used.
  • mongodb/definitions/mongodb.rb is an overriding copy from the mongodb community cookbook to implement our special search query and to retreive the required properties from the data bag.

opsworks-mongodb-example's People

Contributors

ujuettner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.