I have a mongodb replicator on ubuntu. In the replica set, hosts are defined as localhost. You can see:
{ "_id" : "myrep", "version" : 4, "members" : [ { "_id" : 0, "host" : "localhost:27017" }, { "_id" : 2, "host" : "localhost:27018" }, { "_id" : 1, "host" : "localhost:27019", "priority" : 0 } ]
}
I want to change the host address using a real ip server. But when I run rs.reconfig, I get an error:
{ "assertion" : "hosts cannot switch between localhost and hostname", "assertionCode" : 13645, "errmsg" : "db assertion failure", "ok" : 0
}
How can i solve this? Thanks.
source share