Deploy MongoDB - Gapminder/dollar-street-framework GitHub Wiki
For “Prod” use replica set, for all others project use MongoDB in an instance
-
Deployment manager:
For replicaset:
- MongoDB with Replication (Bitnami)
For instance:
- MongoDB certified by Bitnami
** copy PASSWORD
-
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
- VPC network - Firewall rules - Add for mongodb:
- ports: tcp:22; tcp:27017
- tags: mongodb
- VPC network - External IP addresses:
- mongodb external - static
- 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
- 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>"}]
}
)
- Credentials:
- update specific file with certain MODE & NODE & commit
npm run prebuild:client
- Setup backups