小编Sun*_*Sun的帖子

MongoDB 中重新配置 replSet 问题

我曾经在同一个数据库文件夹中尝试过副本集演示。副本集名称为“test”。然后我尝试使用不同的名称“repl”重新构建 repl 集。重新配置后,我收到以下错误消息:

{
        "ok" : 0,
        "errmsg" : "replSetReconfig should only be run on PRIMARY, but my state is REMOVED; use the \"force\" argument to override",
        "code" : 10107,
        "codeName" : "NotMaster"
}
Run Code Online (Sandbox Code Playgroud)

所以我按照 errmsg 操作,并尝试运行以下命令:

rs.reconfig(config,{"force":true})
Run Code Online (Sandbox Code Playgroud)

现在我收到以下错误消息:

{
        "ok" : 0,
        "errmsg" : "New and old configurations differ in replica set name; old was test, and new is repl",
        "code" : 103,
        "codeName" : "NewReplicaSetConfigurationIncompatible"
}
Run Code Online (Sandbox Code Playgroud)

太糟糕了!所以我使用以前的名称“test”。但我再次收到错误。

{                                                                                                                       
        "ok" : 0,                                                                                                       
        "errmsg" : "New and old configurations differ …
Run Code Online (Sandbox Code Playgroud)

replication mongodb

3
推荐指数
1
解决办法
3万
查看次数

标签 统计

mongodb ×1

replication ×1