[英]mongodb keyFile between replicas throws Permission denied
我在本教程中創建了一個具有身份驗證功能的單節點ReplicaSet,一個root用戶和一個keyFile,在同一服務器上的不同端口(37017和47017)中還有兩個mongod進程,並且replSet名稱相同,但是當我嘗試在通過rs.add(“ 172.31.48.41:37017”)連接到PRIMARY的mongo shell中添加輔助數據庫時,我得到:
{
"ok" : 0,
"errmsg" : "Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 172.31.48.41:27017; the following nodes did not respond affirmatively: 172.31.48.41:37017 failed with Failed attempt to connect to 172.31.48.41:37017; couldn't connect to server 172.31.48.41:37017 (172.31.48.41), connection attempt failed",
"code" : 74
}
然后我轉到了PRIMARY的mongod進程日志,發現了這一點:
2015-05-19T20:53:59.848-0400 I REPL [conn51] replSetReconfig admin command received from client
2015-05-19T20:53:59.848-0400 W NETWORK [conn51] Failed to connect to 172.31.48.41:37017, reason: errno:13 Permission denied
2015-05-19T20:53:59.848-0400 I REPL [conn51] replSetReconfig config object with 2 members parses ok
2015-05-19T20:53:59.849-0400 W NETWORK [ReplExecNetThread-0] Failed to connect to 172.31.48.41:37017, reason: errno:13 Permission denied
2015-05-19T20:53:59.849-0400 W REPL [ReplicationExecutor] Failed to complete heartbeat request to 172.31.48.41:37017; Location18915 Failed attempt to connect to 172.31.48.41:37017; couldn't connect to server 172.31.48.41:37017 (172.31.48.41), connection attempt failed
2015-05-19T20:53:59.849-0400 E REPL [conn51] replSetReconfig failed; NodeNotFound Quorum check failed because not enough voting nodes responded; required 2 but only the following 1 voting nodes responded: 172.31.48.41:27017; the following nodes did not respond affirmatively: 172.31.48.41:37017 failed with Failed attempt to connect to 172.31.48.41:37017; couldn't connect to server 172.31.48.41:37017 (172.31.48.41), connection attempt failed
而且應該成為SECONDARY的mongod的日志什么也沒有顯示,最后兩行是:
2015-05-19T20:48:36.584-0400 I REPL [initandlisten] Did not find local replica set configuration document at startup; NoMatchingDocument Did not find replica set configuration document in local.system.replset
2015-05-19T20:48:36.591-0400 I NETWORK [initandlisten] waiting for connections on port 37017
很明顯,我無法在該節點中進行rs.initiate(),因為它將自行投票為PRIMARY,這會產生沖突,因此應將聲明“在啟動時未找到本地副本集配置文檔”的行忽略為據我所知。
因此,我認為許可權應該是確定的,因為我在每個mongod進程中都使用相同的密鑰文件,並且每個配置文件中的replSet都相同,這就是所有需要的教程狀態,但是顯然缺少一些東西。
有任何想法嗎? 這是錯誤嗎?
如果您在兩個實例的安全組中都使用ec2實例和ip 27017端口,則只需添加一個輔助實例端口。 它為我工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.