Deploy MongoDB - Gapminder/dollar-street-framework GitHub Wiki

For “Prod” use replica set, for all others project use MongoDB in an instance

  1. Deployment manager:

    For replicaset:

    • MongoDB with Replication (Bitnami)

    For instance:

    • MongoDB certified by Bitnami

    ** copy PASSWORD

  2. Compute Engine - VM instances - Edit mongodb instance:

    For replicaset:

    • Don't stop the primary instance. Stop secondary instance (node-1 or node-2)

    For instance:

    • stop instance
  • add Network tag: mongodb
  • add your ssh key
  • fix internal IP
  • add ReadWrite acces to Storage API
  • start instance
  1. VPC network - Firewall rules - Add for mongodb:
  • ports: tcp:22; tcp:27017
  • tags: mongodb
  1. VPC network - External IP addresses:
  • mongodb external - static
  1. Mongobooster - Connection:
  • Type: Direct Connection
  • Server: mongodb://localhost:27017
  • SSH Address: EXTERNAL mongodb IP
  • SSH User name
  • SSH Auth mode: Private Key
  • SSH Private Key: ***.pem
  • Authentication Mode: Basic
  • Authentication User name: root
  • Authentication Password: COPIED PASSWORD FROM POINT 1 (last subpoint)
  • Authentication Auth DB: admin
  1. Mongobooster - DB:
  • restore DB
  • create userDB with readWrite role to the restored DB
db.createUser(
   {
     user: "admin-<MODE_ENV>",
     pwd: "<MONGODB_PASSWORD>",
     
     roles: [{"role":"readWrite","db":"<MONGODB_NAME>"}]
   }
)
  1. Credentials:
  • update specific file with certain MODE & NODE & commit
  • npm run prebuild:client
  1. Setup backups
⚠️ **GitHub.com Fallback** ⚠️