私のマシンで実行されている3つのmongodデモレプリケートサーバーがあります。次のコマンドを使用して、複製されたサーバーを作成しました。
F:\>mongod --replSet test2 --dbpath 2 --port 27112 --oplogSize 50 --logpath log.2 --logappend
all output going to: log.2
このように、27111 ポートに test1、27112 ポートに test2、27113 ポートに test3 があります。しかし、構成時にエラーが発生します:
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
}
一致させるにはどうすればよいですか?