Docker environment for course M102: MongoDB for DBAs (https://university.mongodb.com/courses/M102/about)
- docker
- mongodb 3.5
https://docs.docker.com/installation/
http://docs.docker.com/compose/install/
In the project ./book/dev/ (where the Makefile
file is located), run:
make build_all && make bootstrap_all
make shell_mongoshell
then write:
mongo storage:27017/admin -u adminmaster -p passmaster
db.createUser({
user: "usermaster",
pwd: "passmaster",
roles: ["dbAdmin"]
});
db.createUser({
user: "usermaster",
pwd: "passmaster",
roles: ["dbAdmin","dbOwner", "readWrite", "userAdmin"]
});
make shell_weber
then write:
node app.js
docker exec -it m101js_storage_1 /bin/sh
mongorestore --host storage -u adminmaster -p passmaster dump
mongoimport --host storage --port 27017 -u adminmaster -p passmaster --authenticationDatabase admin --drop --db pcat --collection products --file products.json
mongo storage:27017/admin -u adminmaster -p passmaster --shell homework.js