Подтвердить что ты не робот

Не удается подключиться к кластеру Atlas Cluster MongoDB с использованием Mongo Shell

Я создал кластер в 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 работал в фоновом режиме? Если нет, что мне нужно сделать, чтобы успешно подключиться? Спасибо.

4b9b3361

Ответ 1

Мне пришлось создать нового пользователя с другим именем пользователя и паролем, и когда я запустил команду с этими новыми учетными данными, я мог бы подключиться.

Ответ 2

Моя проблема заключалась в том, что я только недавно установил/изменил пароль в пользовательском интерфейсе Atlas - требуется около минуты для их развертывания, даже сброса пароля и т.д. Я смог войти в систему после того, как я ожидал, что изменения будут развернуты

Ответ 3

Как и другие, не понравился мой pw. Работал нормально из командной строки, но не из компаса. Проверка страницы устранения неполадок https://docs.atlas.mongodb.com/troubleshoot-connection/#special-characters-in-connection-string-password. У меня были специальные символы в моем pw. Пытался избежать их, затем просто вернулся и сбросил пароль к чему-то простому без специальных символов - заняло минуту, но потом я подключился легко.