Mongodb on Azure VM: Unable to access Mongodb


Mohit

Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section)

Case 2 . I installed mongoon a Azure Ubuntu VMconfigured mongo bind-ip:127.0.0.1. Remote machines from the same VNet cannot connect to that mongo using the private vnet IP.

MongoDB network setup (case 1 and case 2):

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  

Exception (case 2):

2018-04-03 06:35:29.948 INFO 44518 --- [72.17.1.4:27017] org.mongodb.driver.cluster: Watch thread exception while connecting to server 172.17.1.4:27017

com.mongodb.MongoSocketOpenException: com.mongodb.connection.SocketStream.open(SocketStream.java:63) ~[mongodb-driver-core-3.4.1.jar! Exception at /:na] open socket.InternalStreamConnection.open(InternalStreamConnection.java:115) ~[mongodb-driver-core-3.4.1.jar! /:na] at com.mongodb.connection.DefaultServerMonitor $ServerMonitorRunnable.run(DefaultServerMonitor.java:113) ~[mongodb-driver-core-3.4.1.jar! /:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151] Reason: java.net.ConnectException: Connection refused (java.net.PlainSocketImpl.socketConnect(native method) ~[na:1.8.0_151], at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_151], at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)~ [na:1.8.0_151] on java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) on java.net.SocksSocketImpl.connect~[na:1.8. 0_151] (java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)~[na:1.8.0_151]~Socket.java:589)~[na:1.8.0_151] at com.mongodb.connection.SocketStreamHelper.initialize (SocketStreamHelper.java:57) ~[mongodb-driver-core-3.4.1.jar! /:na] at com.mongodb.connection.SocketStream.open(SocketStream.java:58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... omitted 3 common frameworks open(SocketStream.java:58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... omitted 3 common frameworks open(SocketStream.java:58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... 3 common frames omitted 58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... omitted 3 common frameworks open(SocketStream.java:58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... 3 common frames omitted 58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... omitted 3 common frameworks open(SocketStream.java:58) ~[mongodb-driver-core-3.4.1.jar! /:na] ... 3 common frames omitted

Azure VM behaves differently than Mac OS installation, how is it different?

Note: Change bindIpto IP (172.17.1.4)or will do 0.0.0.0.

renew:

Case 1: The remote access to the local machine mongo is due to my chosen distribution being configured to allow remote connections.

Shui shengbao

From my knowledge, 127.0.0.1only works inside the machine. You can check this blog .

By default, MongoDB only binds to the local interface, which will limit remote connections. Comment out to accept any remote connections if you don't care about security (not recommended).

I suggest you can configure Mongodb like this bind_ip = 127.0.0.1,172.17.1.4.

Related


Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Mongodb on Azure VM: Unable to access Mongodb

Mohit Case 1 . I have installed mongoon my computer (Mac OS), and mongoconfigured bind-ip : 127.0.0.1. Remote computers in the LAN can connect to my mongodb using my IP. (Wrong observation: see "Update" section) Case 2 . I installed mongoon a Azure Ubuntu VMco

Unable to access MongoDB on remote server

Umar I installed MongoDB as a service on a WIndows server. I am trying to access the DB from my personal computer using the remote server's IP and port 27017. I have followed multiple tutorials, but all failed. Below is the configuration file. dbpath = C:\DB\d

Can't connect to MongoDB on new Azure VM

jkruer01 I created a new "container app" in the Azure portal for MongoDB. This used the official MongoDB container from Docker Hub and created an Ubuntu 15.04 box. I've never worked with Docker before. I can SSH into the VM and connect to mongo on the VM. In a

Can't connect to MongoDB on new Azure VM

jkruer01 I created a new "container app" in the Azure portal for MongoDB. This used the official MongoDB container from Docker Hub and created an Ubuntu 15.04 box. I've never worked with Docker before. I can SSH into the VM and connect to mongo on the VM. In a

Connection to MongoDb on Azure VM times out

Davide Icardi I'm having some timeout issues connecting my Azure web app to MongoDb hosted on an Azure VM. 2015-12-19T15:57:47.330+0100 I NETWORK Socket recv() errno:10060 A connection attempt failed because the connected party did not properly respond afte

Connection to MongoDb on Azure VM times out

Davide Icardi I'm having some timeout issues connecting my Azure web app to MongoDb hosted on an Azure VM. 2015-12-19T15:57:47.330+0100 I NETWORK Socket recv() errno:10060 A connection attempt failed because the connected party did not properly respond afte

Connection to MongoDb on Azure VM times out

Davide Icardi I'm having some timeout issues connecting my Azure web app to MongoDb hosted on an Azure VM. 2015-12-19T15:57:47.330+0100 I NETWORK Socket recv() errno:10060 A connection attempt failed because the connected party did not properly respond afte

Connection to MongoDb on Azure VM times out

Davide Icardi I'm having some timeout issues connecting my Azure web app to MongoDb hosted on an Azure VM. 2015-12-19T15:57:47.330+0100 I NETWORK Socket recv() errno:10060 A connection attempt failed because the connected party did not properly respond afte

Connection to MongoDb on Azure VM times out

Davide Icardi I'm having some timeout issues connecting my Azure web app to MongoDb hosted on an Azure VM. 2015-12-19T15:57:47.330+0100 I NETWORK Socket recv() errno:10060 A connection attempt failed because the connected party did not properly respond afte

Remote access to mongodb? unable to do so

username I am a bit new to mongodb. What I want to do is access a database hosted on MONGOHQ. The page that visits the page is hosted on a different server, and every time I visit the page, I get the following message: > Fatal error: Class 'Mongo' not found in

Remote access to mongodb? unable to do so

username I am a bit new to mongodb. What I want to do is access a database hosted on MONGOHQ. The page that visits the page is hosted on a different server, and every time I visit the page, I get the following message: > Fatal error: Class 'Mongo' not found in

How to remotely access gcp port of mongodb on gcp VM?

Aranka Dury I have mongodb installed and running on port 27017 of the VM with gcp. But I can't access the database from PC or any external client. I have set up firewall rules to allow incoming traffic for tcp protocol on port 27017 (tcp:27017) from all IP ran

How to remotely access gcp port of mongodb on gcp VM?

Aranka Dury I have mongodb installed and running on port 27017 of the VM with gcp. But I can't access the database from PC or any external client. I have set up firewall rules to allow incoming traffic for tcp protocol on port 27017 (tcp:27017) from all IP ran

How to remotely access gcp port of mongodb on gcp VM?

Aranka Dury I have mongodb installed and running on port 27017 of the VM with gcp. But I can't access the database from PC or any external client. I have set up firewall rules to allow incoming traffic for tcp protocol on port 27017 (tcp:27017) from all IP ran

Unable to access Jupyter Notebook on Azure Deep Learning VM

Prajna I followed the directions here . I'm on an Ubuntu VM via SSH. I try to access IP: 8000, but the Chrome browser shows that the website cannot be reached. As stated in the documentation, port 8000 is indeed open by default by default. The instructions did

Unable to access Jupyter Notebook on Azure Deep Learning VM

Prajna I followed the directions here . I'm on an Ubuntu VM via SSH. I try to access IP: 8000, but the Chrome browser shows that the website cannot be reached. As stated in the documentation, port 8000 is indeed open by default by default. The instructions did

Unable to access Jupyter Notebook on Azure Deep Learning VM

Prajna I followed the directions here . I'm on an Ubuntu VM via SSH. I try to access IP: 8000, but the Chrome browser shows that the website cannot be reached. As stated in the documentation, port 8000 is indeed open by default by default. The instructions did