项目作者: pahharo

项目描述 :
MongoDB HA deployment with docker
高级语言: Shell
项目地址: git://github.com/pahharo/mongodb_ha_deployment.git
创建时间: 2018-02-08T09:03:25Z
项目社区:https://github.com/pahharo/mongodb_ha_deployment

开源协议:GNU General Public License v3.0

下载


mongodb_ha_deployment

MongoDB HA deployment with docker

Requirements

· Docker (version 17.09.0-ce used).
· Linux OS (Ubuntu 16.04 Distribution used).

Pull images (Option 1)

To pull the images from the repo:

  1. # ./pull_containers.sh

Build images (Option 2)

To build images from local project:

  1. # ./build_containers.sh

Run containers:

To deploy our mongodb cluster with the default configuration:

  1. # ./run_all.sh

Check that all is ok:

To check that all is working ok:

  1. # mongo --host 172.18.0.10 Requirement --eval 'db.Requirements.insertOne({"Granada": "Alhambra"})'
  2. # mongo --host 172.18.0.10 Requirement --eval 'db.Requirements.find()'

If it goes well, now you have to bring down the primary mongodb:

  1. # docker stop mongodb_1

After that, you have to request again for the content of the Requirements collection:

  1. # mongo --host 172.18.0.10 Requirement --eval 'db.Requirements.find()'

If it does not respond in the first request, try again (the cluster has to reconfigure).
The respond must be the same ({“Granada”: “Alhambra”}).

Remove containers

To remove the containers:

  1. # ./remove_containers.sh