Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.28 KB

README.md

File metadata and controls

31 lines (23 loc) · 1.28 KB

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