Home > database >  MongoDB Arbiter No Respond When Using rs.addArb()
MongoDB Arbiter No Respond When Using rs.addArb()

Time:05-11

I am setting up a two-replicate and one arbiter setup, the reference is from enter image description here

CodePudding user response:

I have finally fixed this stuff.

Instead of SSH into the server and using its SSH's mongo shell, I changed to Mongo Compass and use their shell.

Right immediately the error pops up.

CodePudding user response:

You follow better Deploy a Replica Set and Add an Arbiter to Replica Set

The reference you linked in your question will not work, it has several faults:

MongoDB configuration files use the YAML format. Plain edits like

# vi /etc/mongod.conf
replSet = prodRepl

do not work. Perhaps this was different in 2014/2016 when the page was written.

He enables authentication (which is really honorably), however he starts the arbiter service nohup mongod --port 30000 --dbpath /var/lib/mongo/data --replSet replicaset01 --bind_ip_all without authentication (i.e. --auth and --keyFile are missing).

Apart from that, you would need to start the Arbiter every time you boot the machine. Why not simply edit the existing configuration file /etc/mongod.conf?

  • Related