Skip to content

Fully-automated MongoDB replica set "dockerization", from scratch

Notifications You must be signed in to change notification settings

deRemo/containerized-mongodb

Repository files navigation

containerized-mongodb

Container network

The purpose of this repo is to show how to containerize MongoDB from scratch and how to configure a replica set between multiple mongod instances.

Utility tool for my research project RT-MongoDB (https://gitlab.retis.santannapisa.it/t.cucinotta/mongo/-/tree/v4.4-rt)

NOTE: This tool is designed for RT-MongoDB, thus it makes use of tuning server parameters that do not exist on the original MongoDB

Example of usage with 2 replica nodes

Clone the repo on both hosts, make sure that the Python scripts are executable and the hosts reachable, then perform the following instructions in the respective shells:

 user@primary_host:~/dockerized-mongodb$ ./build_images.py
 user@primary_host:~/dockerized-mongodb$ ./run.py
 
 user@secondary_host:~/dockerized-mongodb$ ./build_images.py
 user@secondary_host:~/dockerized-mongodb$ ./run.py
 
 user@primary_host:~/dockerized-mongodb$ ./configure_rs.py ip_primary ip_secondary

Now you can interact with the database:

user@primary_host:~/dockerized-mongodb$ mongo --host primary_host

Warning

Any changes to the files may compromise the basic functionality of the software

About

Fully-automated MongoDB replica set "dockerization", from scratch

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages