Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36173

connection string with multiple mongos fails

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.9
    • Component/s: Shell, Usability
    • Labels:
      None

      According to mongodb's documentation, the following connects to a sharded cluster with three mongos instances:

      mongodb://router1.example.com:27017,router2.example2.com:27017,router3.example3.com:27017/

      This seems not to work because we are receiving the following error:

      2018-07-18T10:01:50.053+0200 E QUERY [thread1] Error: Cannot list multiple servers in URL without 'replicaSet' option :
      connect@src/mongo/shell/mongo.js:237:13

      We are running mongo version 3.4 (all mongos-es, mongod's and mongo shell are running v3.4).

      We can connect to each mongos individually without problems:

      10:10:15 > $ mongo mongo-shared-05.db00.pro06.eu.idealo.com:27017
      MongoDB shell version v3.4.9
      connecting to: mongo-shared-05.db00.pro06.eu.idealo.com:27017
      MongoDB server version: 3.4.10
      mongos> ^C
      bye
      10:10:35 > $ mongo mongo-shared-06.db00.pro05.eu.idealo.com:27017
      MongoDB shell version v3.4.9
      connecting to: mongo-shared-06.db00.pro05.eu.idealo.com:27017
      MongoDB server version: 3.4.15
      mongos> ^C
      bye
      10:11:15 > $ mongo mongo-shared-07.db00.pro06.eu.idealo.com:27017
      MongoDB shell version v3.4.9
      connecting to: mongo-shared-07.db00.pro06.eu.idealo.com:27017
      MongoDB server version: 3.4.10
      mongos> ^C
      bye

      However, once put together all three mongos-es in one connection string, we get the above mentioned error:

      10:11:36 > $ mongo mongodb://mongo-shared-05.db00.pro06.eu.idealo.com:27017,mongo-shared-06.db00.pro05.eu.idealo.com:27017,mongo mongo-shared-07.db00.pro06.eu.idealo.com:27017/
      FailedToParse: Cannot list multiple servers in URL without 'replicaSet' option
      try 'mongo --help' for more information

            Assignee:
            nick.brewer Nick Brewer
            Reporter:
            kay.agahd@idealo.de Kay Agahd
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: