The idea is to have like-prod layout what could be install locally for test purposes
- docker
- docekr-compose
- docker-compose up -d
-
curl ${VM_IP}:27017
it shout returt "It looks like you are trying to access MongoDB over HTTP on the native driver port"
VM_IP - IP of the Nginx LoadBalancer (VM IP) -
docker exec -ti db01 bash
2.1 mongo
2.2 rs.status()
is should returnt the status of replica-set with no issues
-
http://media.mongodb.org/zips.json could be used as simple data (a couple of lines is enough)
- docker exec -ti mongoClient bash
- mongoimport --host ${RS_NAME}/${VM_IP}:27017 -d test-db --file /opt/test.json (some lines from 1. already saved as /opt/test.json)
RS_NAME - name of the replication set (rs0 in that example)
VM_IP - IP of the Nginx LoadBalancer(VM IP)
- docker-compose rm -f -s -v