Ho tre server di replica demo mongod in esecuzione sulla mia macchina. Ho usato seguente comando per creare server replicato:Il nome del set di mongoDB non corrisponde a
F:\>mongod --replSet test2 --dbpath 2 --port 27112 --oplogSize 50 --logpath log.2 --logappend
all output going to: log.2
come non ho test1 su 27111 porta, test2 su 27112 porto e test3 su 27113 porta. Eppure alla configurazione sto ricevendo un errore:
cfg = {
"_id" : "test1",
"members" : [
{
"_id" : 0,
"host" : "localhost:27111"
},
{
"_id" : 1,
"host" : "localhost:27112"
},
{
"_id" : 2,
"host" : "localhost:27113"
}
]
}
> rs.initiate(cfg)
{
"errmsg" : "couldn't initiate : set name does not match the set name host localhost:27112 expects",
"ok" : 0
}
Ora che cosa devo fare per farlo corrispondere?
provato {host: "127.0.0.1:1:27111"} e non funziona. – sadaf2605