I'm running a 2 member replica set - at the moment if the member which should run as secondary is down, then the remaining member goes into seondary mode - resulting in the whole system being down.
What is the best way to update my config so that the db1 will vote itself as Primary even if it can't find db2?
{
"_id" : "qsdb",
"version" : 1,
"members" : [
{
"_id" : 0,
"host" : "db1:27017",
"priority" : 2
},
{
"_id" : 1,
"host" : "db2:27017"
}
]
}
fg=rs.conf()
{
"_id" : "qsdb",
"version" : 1,
"members" : [
{
"_id" : 0,
"host" : "db1:27017",
"priority" : 2
},
{
"_id" : 1,
"host" : "db2:27017"
}
]
}
Logs from db1:
BOOST_LIB_VERSION=1_49
Mon Oct 15 13:04:44 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log", replSet: "qsdb", rest: "true" }
Mon Oct 15 13:04:45 [initandlisten] journal dir=/var/lib/mongodb/journal
Mon Oct 15 13:04:45 [initandlisten] recover : no journal files present, no recovery needed
Mon Oct 15 13:04:50 [initandlisten] waiting for connections on port 27017
Mon Oct 15 13:04:50 [websvr] admin web console waiting for connections on port 28017
Mon Oct 15 13:04:51 [initandlisten] connection accepted from
127.0.0.1:43449 #1 (1 connection now open)
Mon Oct 15 13:04:54 [rsStart] replSet I am db1:27017
Mon Oct 15 13:04:57 [rsStart] replSet STARTUP2
Mon Oct 15 13:04:57 [rsMgr] replSet total number of votes is even - add arbiter or give one member an extra vote
Mon Oct 15 13:04:58 [rsSync] replSet SECONDARY
Mon Oct 15 13:05:00 [rsHealthPoll] couldn't connect to db2:27017: couldn't connect to server db2:27017