我有一個分區的MongoDB設置。AuthenticationFailed:分片MongoDB上的用戶文檔中缺少MONGODB-CR憑證:無法連接到:queryrouter0.example.com:27017:
我想從我的Laravel應用
連接到它之前我分片我的數據庫我用laravel-mongodb連接到我的正常MongoDB實例。
這是我以前的配置
'mongodb' => array(
'driver' => 'mongodb',
'host' => env('MONGODB_HOST', 'localhost'),
'port' => env('MONGODB_PORT', 27017),
'username' => env('MONGODB_USERNAME', ''),
'password' => env('MONGODB_PASSWORD', ''),
'database' => env('MONGODB_DATABASE', ''),
'options' => array(
'db' => env('MONGODB_AUTHDATABASE', '') //Sets the auth DB
)
)
我嘗試更新MONGODB_HOST
到分片查詢路由器的主機名,但現在我得到的錯誤
[MongoConnectionException] 無法連接到: queryrouter0.example.com:27017:使用用戶名'maxrosecollins'驗證數據庫'admin'失敗:驗證失敗'
我可以在日誌中看到queryrouter0.example.com
服務器上
2017-09-05T14:42:36.558 + 0000我NETWORK [線程2]從45.32.144.169:33086#41615連接接受(1個連接現在打開) 2017-09-05T14:42:36.560 + 0000我訪問[conn41615] authenticate db:admin {authenticate:1,user:「maxrosecollins」,nonce:「xxx」,key:「xxx」}
2017- 09-05T14:42:36.562 + 0000 I ACCESS [conn41615]用機制MONGODB-CR驗證maxrosecollins @ admin失敗:AuthenticationFailed:用戶文檔中缺少MONGODB-CR憑證
2017-09-05T14:42:36.563 + 0000 I - [conn41615]端連接45.32.144.169:33086(1連接現在打開)
我可以連接到使用以下查詢路由器。 這是在同一臺服務器上,我使用laravel時遇到auth失敗錯誤。我有雙重檢查密碼和用戶名
mongo queryrouter0.example.com:27017 -u "maxrosecollins" -p "password" --authenticationDatabase "admin"
我不應該被連接到查詢路由器不是碎片? –