jbossews.log段:jbossews登錄openshift顯示com.mongodb.CommandFailureException:{「serverUsed」:「127.xx2.xxx.xx0:27017」,「ok」:0.0,「errmsg」:「未授權」}
引起:com.mongodb.CommandFailureException:{ 「serverUsed」: 「127.xxx.xx3.xx0:27017」, 「OK」:0.0 「ERRMSG」: 「未授權」} 在com.mongodb.CommandResult.getException(CommandResult.java:76) 在com.mongodb.CommandResult.throwOnError(CommandResult.java:131)
的mongodb.log段:我覺得它給我ABO由於「命令被拒絕:{listDatabases:1}」行,因此例外情況爲 。
Sun Apr 12 12:30:24.150 [conn1] authenticate db:admin {authenticate:1,nonce:「#####」,user:「admin」,key:「##### #「}
Sun Apr 12 12:31:54.580 [conn3] authenticate db:mydb {authenticate:1,user:」admin「,nonce:」#######「,key:」#### ###「}
Sun Apr 12 12:31:54.582 [conn3] command denied:{listDatabases:1}
Sun Apr 12 13:20:14.781 [conn4] authenticate db:admin {authenticate:1,user: 「admin」,nonce:「######」,key:「#######」}
Sun Apr 12 13:20:15.031 [conn4] command mydb。$ cmd command:{$ eval :CodeWScope(function(){return db.getCollectionNames();},{}),args:{} } ntoreturn:1 keyUpdates:0 locks(micros)W:223980 reslen:109 224ms
Sun Apr 12 13:20:15.141 [conn5] authenticate db:admin {authenticate:1,user:「admin」,nonce:「# #####」,鍵: 「#######」}
我缺少什麼?任何幫助將不勝感激。
用戶'admin'做MongoDB中的listDatabases操作不具有運行該命令的權限。檢查「admin」的權限。 – wdberkeley
用戶管理員擁有所有權限,它是mongoDB carteridge的默認用戶。我認爲listDatabases操作在mydb數據庫上執行,它應該在管理數據庫上執行。我試着在mydb數據庫上運行{listDatabases:1}。它給了我同樣的錯誤。 –