In /opt/zw-vmmc-docker/mongo you need to create mongo-init.js:
Create file:
vim /opt/zw-vmmc-docker/mongo/mongo-init.js
And paste the next lines:
//mongo Init use admin db.createUser( { user: "<user>", pwd: "<password>", mechanisms: ["SCRAM-SHA-1"], roles: [ { role: "readWrite", db: "db1" }, { role: "readWrite", db: "dbOthers" }, { role: "readWrite", db: "dbLog" }, ] } ); use db1 db.createUser( { user: "<user>", pwd: "<password>", mechanisms: ["SCRAM-SHA-1"], roles: [ { role: "readWrite", db: "db1" }, { role: "readWrite", db: "dbOthers" }, { role: "readWrite", db: "dbLog" }, ] } ); use dbOthers db.createUser( { user: "<user>", pwd: "<password>", mechanisms: ["SCRAM-SHA-1"], roles: [ { role: "readWrite", db: "db1" }, { role: "readWrite", db: "dbOthers" }, { role: "readWrite", db: "dbLog" }, ] } ); use dbLog db.createUser( { user: "<user>", pwd: "<password>", mechanisms: ["SCRAM-SHA-1"], roles: [ { role: "readWrite", db: "db1" }, { role: "readWrite", db: "dbOthers" }, { role: "readWrite", db: "dbLog" }, ] } );
You will need to replace “<user>” and “<pwd>” with the user and password existing here: mongo-user
You will also need to download backups log-backup.gz and prod-backup.gz. Temporally, you can get them from api-dev.psi-connect.org, in the next path: /opt/tomcat/mongo-test-backups And paste in /opt/zw-vmmc-docker/mongo/backups
About the Mongo configuration, we will finish the configuration when we focus on the docker-compose.yml file.