Я создал кластер в Atlas MongoDB и сделал себя администратором, но у меня возникли проблемы с подключением к кластеру из оболочки. В Atlas я нажал кнопку подключения, щелкнул соединение с Mongo Shell, загрузил последнюю версию Mongo Shell и скопировал команду для подключения к кластеру:
mongo "mongodb://testcluster-shard-00-00-acqhf.mongodb.net:27017,testcluster-shard-00-01-acqhf.mongodb.net:27017,testcluster-shard-00-02-acqhf.mongodb.net:27017/test?replicaSet=TestCluster-shard-0" --authenticationDatabase admin --ssl --username <USERNAME> --password <PASSWORD>
Когда я запускаю эту команду, я получаю поток:
MongoDB shell version v3.4.10
connecting to: mongodb://testcluster-shard-00-00-
acqhf.mongodb.net:27017,testcluster-shard-00-01-
acqhf.mongodb.net:27017,testcluster-shard-00-02-
acqhf.mongodb.net:27017/test?replicaSet=TestCluster-shard-0
2017-11-20T11:58:31.883-0500 I NETWORK [thread1] Starting new replica set monitor for TestCluster-shard-0/testcluster-shard-00-00-
acqhf.mongodb.net:27017,testcluster-shard-00-01-
acqhf.mongodb.net:27017,testcluster-shard-00-02-acqhf.mongodb.net:27017
2017-11-20T11:58:32.119-0500 I NETWORK [thread1] Successfully connected to testcluster-shard-00-01-acqhf.mongodb.net:27017 (1 connections now open to testcluster-shard-00-01-acqhf.mongodb.net:27017 with a 5 second timeout)
2017-11-20T11:58:32.131-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Successfully connected to testcluster-shard-00-00-acqhf.mongodb.net:27017 (1 connections now open to testcluster-shard-00-00-acqhf.mongodb.net:27017 with a 5 second timeout)
MongoDB server version: 3.4.10
2017-11-20T11:58:32.407-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] Successfully connected to testcluster-shard-00-02-acqhf.mongodb.net:27017 (1 connections now open to testcluster-shard-00-02-acqhf.mongodb.net:27017 with a 5 second timeout)
2017-11-20T11:58:32.497-0500 I NETWORK [thread1] Marking host testcluster-shard-00-01-acqhf.mongodb.net:27017 as failed :: caused by :: Location8000: can't authenticate against replica set node testcluster-shard-00-01-acqhf.mongodb.net:27017: bad auth Authentication failed.
2017-11-20T11:58:32.639-0500 I NETWORK [thread1] Successfully connected to testcluster-shard-00-02-acqhf.mongodb.net:27017 (1 connections now open to testcluster-shard-00-02-acqhf.mongodb.net:27017 with a 0 second timeout)
2017-11-20T11:58:32.756-0500 I NETWORK [thread1] Marking host testcluster-shard-00-02-acqhf.mongodb.net:27017 as failed :: caused by :: Location8000: can't authenticate against replica set node testcluster-shard-00-02-acqhf.mongodb.net:27017: bad auth Authentication failed.
2017-11-20T11:58:32.899-0500 I NETWORK [thread1] Successfully connected to testcluster-shard-00-00-acqhf.mongodb.net:27017 (1 connections now open to testcluster-shard-00-00-acqhf.mongodb.net:27017 with a 0 second timeout)
2017-11-20T11:58:32.995-0500 I NETWORK [thread1] Marking host testcluster-shard-00-00-acqhf.mongodb.net:27017 as failed :: caused by :: Location8000: can't authenticate against replica set node testcluster-shard-00-00-acqhf.mongodb.net:27017: bad auth Authentication failed.
2017-11-20T11:58:33.100-0500 I NETWORK [thread1] Marking host testcluster-shard-00-01-acqhf.mongodb.net:27017 as failed :: caused by :: Location8000: can't authenticate against replica set node testcluster-shard-00-01-acqhf.mongodb.net:27017: bad auth Authentication failed.
2017-11-20T11:58:33.101-0500 E QUERY [thread1] Error: can't authenticate against replica set node testcluster-shard-00-01-acqhf.mongodb.net:27017: bad auth Authentication failed. :
[email protected]/mongo/shell/db.js:1461:20
@(auth):6:1
@(auth):1:2
exception: login failed
Я заменяю и с моим именем пользователя и паролем, но я до сих пор не могу подключиться. Мне нужно, чтобы mounod работал в фоновом режиме? Если нет, что мне нужно сделать, чтобы успешно подключиться? Спасибо.