A Go program to set up Docker Engine and initialize a MongoDB replica set.
docker.go | ||
go.mod | ||
go.sum | ||
inst_deps.go | ||
main.go | ||
mongo_replica_init.go | ||
network.go | ||
python-reference.py | ||
README.md | ||
systemcheck.go |
Mongo Replica Initializer
Usage
- Clone this repo
git clone https://forge.techtransthai.org/latenightdef/mongo-replica-initializer.git
cd mongo-replica-initializer
- 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"
- 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