You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having difficultly connecting to MongoDB remotely. It appears it is trying to connect to localhost regardless of what the hostname or URI/URL is set to.
I am able to connect to MongoDB from Compass (GUI) using the URL mongodb://10.192.10.70:27017/?directConnection=true
I am able to connect to MongoDB using elixir-mongo/mongodb if I run elixir on the the same server as mongo (localhost) using: {:ok, conn} = Mongo.start_link(url: "mongodb://localhost:27017/parties"}
However, from a remote computer the following command produces an error.
I am having difficultly connecting to MongoDB remotely. It appears it is trying to connect to localhost regardless of what the hostname or URI/URL is set to.
I am able to connect to MongoDB from Compass (GUI) using the URL mongodb://10.192.10.70:27017/?directConnection=true
I am able to connect to MongoDB using elixir-mongo/mongodb if I run elixir on the the same server as mongo (localhost) using:
{:ok, conn} = Mongo.start_link(url: "mongodb://localhost:27017/parties"}
However, from a remote computer the following command produces an error.
I tried the following, all with the same error about (Mongo.Error) localhost:27017 tcp connect: connection refused
I did toss some debug code into Mongo.Protocol.Utils and Mongo.UrlParser which shows it has the correct URL
But the inspect output of opts from Mongo.Protocol shows tcp_connect has the following opts:
Note hostname is now "localhost" oops.
The text was updated successfully, but these errors were encountered: