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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: 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
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
              Kristofer Brandow (Inactive)
              Reporter:
              Yong Wei Lun
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: