Hello,
I am trying to deploy a MongoDB replica set. On first deployment I run the command:
mongod --bind_ip 0.0.0.0 --oplogSize 128 --replSet rs0 --storageEngine wiredTiger
This works fine and after my Render service launches I can initialize my replica set with:
rs.initiate({ _id: 'rs0', members: [ { _id: 0, host: 'mongo0:27017' } ]})
However, if I redeploy this mongo instance it will not rejoin the replica set and give this message:
rs.status()
{ "operationTime" : Timestamp(1615929974, 2), "ok" : 0, "errmsg" : "Our replica set config is invalid or we are not a member of it", "code" : 93, "codeName" : "InvalidReplicaSetConfig", "$clusterTime" : { "clusterTime" : Timestamp(1615929974, 2), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } }
I am trying to figure out how to make sure the mongo instance will re join the replica set on restart.