Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-879

Not able to connect to MongoDB Atlas without starting local Mongo server

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.0.0-rc1
    • Component/s: Connections
    • None
    • Environment:
      Ubuntu 18.04.2 LTS,
      Go version go1.12 linux/amd64

      I connect to MongoDB Atlas with the following code segment

      client, err := mongo.NewClient(options.Client().ApplyURI("mongodb+srv://admin:admin@cluster0-7odzu.mongodb.net/test"))

      I was not able to connect to the cluster, hitting this error

       

      2019/03/15 15:02:29 server selection error: server selection timeout current topology: Type: Unknown Servers: Addr: localhost:27017, Type: Unknown, State: Connected, Avergage RTT: 0, Last error: dial tcp 127.0.0.1:27017: connect: connection refused exit status 1
      

      However, when I start my local Mongod service, it can connect, everything works fiine

            Assignee:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Reporter:
            weilun_95@hotmail.com Yong Wei Lun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: