Ho un replicaset mongodb su ubuntu .. Nel set di repliche, gli host sono definiti come localhost. Puoi vedere ;mongodb replicaset nome host errore di modifica
{
"_id" : "myrep",
"version" : 4,
"members" : [
{
"_id" : 0,
"host" : "localhost:27017"
},
{
"_id" : 2,
"host" : "localhost:27018"
},
{
"_id" : 1,
"host" : "localhost:27019",
"priority" : 0
}
]
}
voglio cambiare ospite indirizzi con IP reale del server. Ma quando ho eseguito rs.reconfig, ottengo l'errore:
{
"assertion" : "hosts cannot switch between localhost and hostname",
"assertionCode" : 13645,
"errmsg" : "db assertion failure",
"ok" : 0
}
come posso risolverlo? Grazie.
Questo funziona - è necessario riavviare mongod in seguito, al fine di garantire la nuova impostazione host viene prelevato. In caso di esito positivo, "rs.status()" restituirà il nome host corretto per ciascun membro. – seanhodges
Questo aggira l'errore cambiando gli host, ma ho scoperto che dovevo anche eseguire cfg = rs.conf(); rs.reconfig (CFG); dopo il riavvio per rendere questo bastone. – asparagino