无法使用MongoDB 3configuration副本集

我正在尝试在MongoDB版本3.04中创build一个副本集。 我遵循本教程 ,尝试使用主服务器添加节点时出现下一个错误:

vacrep:PRIMARY> rs.add('server address here') { "ok" : 0, "errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: PRIMARYSERVER:27017; the following nodes did not respond affirmatively: 'server address here':27017 failed with Missing credentials for authenticating as internal user", "code" : 74 } 

到目前为止,

  1. 安装3个服务器与MongoDB 3.04
  2. 以repSet模式运行所有的MongoDB实例
  3. 使用此方法validation服务器之间的连接
  4. 在主服务器中启动一个副本)

我发现几个关于这个错误的线程没有,但在任何一个都找不到解决scheme。 我该如何解决这个问题?

find解决scheme – 这是权限问题。

在MongoDBconfiguration文件中,我必须closures身份validation模式或使用本指南在所有节点之间创build一个共享密钥:

https://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/#deploy-repl-set-with-auth

这是我的服务器无法互相沟通的原因。

除了上面的答案显然是正确的,下面的步骤将有助于创buildkeyFiles:

  1. 在任何文本编辑器中打开新的选项卡,粘贴任何你想要的随机键没有任何空格。
  2. 保存没有扩展名的文件
  3. closures每个mongo实例如下:

    一个。 use admin

    db.shutdownServer();

  4. 现在用keyFile作为参数重新启动mongo实例。

    例如start "jaguar" mongod --dbpath "D:\Mongo\data\Replica Sets\Jaguar" --port 50000 --replSet "clusterset" --keyFile "D:\Mongo\data\Replica Sets\Jaguar\Key\F2AB9B2DCF7933733A35EE9C81C34"