Ich habe 3 Mongod-Demo-Replikate Server auf meinem Rechner laufen. Ich habe folgenden Befehl verwendet replizierten Server zu erstellen:MongoDB-Set-Name passt nicht
F:\>mongod --replSet test2 --dbpath 2 --port 27112 --oplogSize 50 --logpath log.2 --logappend
all output going to: log.2
Mag ich auf 27111 Port Test1 haben, test2 auf 27112 Hafen und test3 auf 27113 Port. Aber bei der Konfiguration bekomme ich einen Fehler:
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
}
Nun, was muss ich tun, damit es übereinstimmt?
versucht {host: "127.0.0.1:1:27111"} und es funktioniert nicht. – sadaf2605