A Go program to set up Docker Engine and initialize a MongoDB replica set.
Find a file
2024-06-27 02:31:17 +07:00
docker.go an attempt to initialize the mongo replica set, known NOT working. 2024-05-21 17:21:49 +07:00
go.mod an attempt to initialize the mongo replica set, known NOT working. 2024-05-21 17:21:49 +07:00
go.sum an attempt to initialize the mongo replica set, known NOT working. 2024-05-21 17:21:49 +07:00
inst_deps.go implement installer for Debian, Fedora and CentOS 2024-05-17 15:39:55 +07:00
main.go Implement adding members based on local ip 2024-05-27 16:04:43 +07:00
mongo_replica_init.go Fix invalid local ip and aloow setting password in main.go 2024-05-27 17:12:31 +07:00
network.go Implement adding members based on local ip 2024-05-27 16:04:43 +07:00
python-reference.py reduce number of containers and add python reference 2024-05-17 11:26:27 +07:00
README.md Add README 2024-06-27 02:31:17 +07:00
systemcheck.go implement basic mongo initialization code for ubuntu 2024-05-16 12:06:38 +07:00

Mongo Replica Initializer

Usage

  1. Clone this repo
git clone https://forge.techtransthai.org/latenightdef/mongo-replica-initializer.git
cd mongo-replica-initializer
  1. Modify the top part of main.go to suit your needs
var mongoBasePath = "/opt/my-mongo"
var replicasetName = "techtransthai-db"
var networkName = "mongonet"
var numberOfContainers int = 2
var maxMemAllocPercent int = 80
var mongoInitdbRootUsername = "sasha"
var mongoInitdbRootPassword = "12345"
  1. Build and run
go get
go build
sudo ./main
# Or run in verbose mode
sudo ./main -v
# Or run in local IP mode, so you don't need directConnection=true
sudo ./main -localip