Mam 3 demo mongody replikuje serwery uruchomione na moim komputerze. Użyłem następujące polecenie, aby utworzyć serwer replikowanego:Nazwa zestawu mongoDB nie pasuje
F:\>mongod --replSet test2 --dbpath 2 --port 27112 --oplogSize 50 --logpath log.2 --logappend
all output going to: log.2
lubię tego mam test1 na porcie 27111, 27112 test2 na port i test3 na porcie 27113. Jednak w konfiguracji pojawia się błąd:
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
}
Co muszę zrobić, aby pasował?
próbował {host: "127.0.0.1:1:27111"} i to nie działa. – sadaf2605