Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
Why cant I connect to replica set using mongo shell?

I can connect to replica set using following command from mongo shell version 3.2.11. But the same does not works with mongo shell v3.4.1.

mongo --host \
      "replicaSet1/10.10.10.15:27001,10.10.10.16:27002,10.10.10.17:27000" mydbname \
      -u root -p root \
      --authenticationDatabase admin

 [main] Error: Failed to parse mongodb:// URL: mongodb://replicaSet1/10.10.10.15:27001,10.10.10.16:27002,10.10.10.17:27000/mydbname :

I have read here that replica set address format has not changed since v 3.4.1 release.

Why cant I connect to db ? What is the parse error, as per new format(if its there).

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This is a known regression in MongoDB 3.4.0/3.4.1: SERVER-27289: mongo --host replSet/Host:Port no longer works. A fix has been committed for the upcoming MongoDB 3.4.2 release.

You can work around this in an affected 3.4.x mongo shell by using the standard MongoDB Connection String URI format instead:

mongo --host mongodb://10.10.10.15:27001,10.10.10.16:27002,10.10.10.17:27000/mydbname?replicaSet=replicaSet1

You can also use a standard MongoDB Connection String as a plain argument (i.e. without the --host parameter):

mongo mongodb://10.10.10.15:27001,10.10.10.16:27002,10.10.10.17:27000/mydbname?replicaSet=replicaSet1

I have read here that replica set address format has not changed since v 3.4.1 release.

Support for using the standard MongoDB Connecting String format in the --host parameter was added in MongoDB 3.4 in order to align the mongo shell connection string syntax with the format used by all official drivers.

This change is currently not noted in the MongoDB 3.4 manual, so I've raised DOCS-9808 to clarify.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!