MongoDB Failed To Connect – Error 10061

I recently built a single MongoDB server on a Ubuntu 16.04 LTS server, and I was trying to connect to it with mongoimport from a Windows machine.

C:\Program Files\MongoDB\Server\3.2\bin>mongo –host ubuntu-mongodb
MongoDB shell version: 3.2.8
connecting to: ubuntu-mongodb:27017/test
2017-11-26T17:22:21.224+0000 W NETWORK [thread1] Failed to connect to, reason: errno:10061 No connection could be made because the target machine actively refused it.
2017-11-26T17:22:21.224+0000 E QUERY [thread1] Error: couldn’t connect to server ubuntu-mongodb:27017, connection attempt failed :

A local connection was working using the mongo shell, but not remotely, so I started puzzling about firewalls either on Windows or Ubuntu. As a further test, I tried a connection from another Windows machine – a Windows 10 laptop – with the same result. The remote Ubuntu server obviously responded to pings.

Drawing a blank with firewalls, I did start to consider whether MongoDB disables remote connections by default, something that has become increasingly common with database platforms for obvious reasons. I had a quick look at the mongodb.conf file, and the local loopback IP address stood out for the bind_ip parameter:

# Listen to local interface only. Comment out to listen on all interfaces.

I opened the mongodb.conf file in VI, commented out the line with bind_ip – and then spend far too many minutes wondering why it wouldn’t let me save it. I’d forgotten to sudo to VI.

MongoDB University releases Android App

MongoDB University has offered some pretty good, and free, training videos for DBAs and especially for Developers. One of the limitations has been that the videos are powered by Youtube, so offline viewing has not been possible. However, this has now been fixed with the release of the Android App to complement the iOS flavour app that was released in September.

My first thoughts, having used the MongoDB Android App to watch some of the DBA-track learning, is that it suffers from the same stop-and-start that watching it online does. Some of the videos are as long as 7-9 minutes, but many of them are just a couple of minutes – and I find it irritating having to click something to move on to the next video. This is something that previous versions of the Pluralsight Android app, when the account is enabled for download content, does seemlessly – it just flows.