Question

I am facing an issue with the mongodb 4.0. I have setup mongodb on remote server and want to connect it with robo3t. But getting the below error.

enter image description here

And here is my mongodb.conf file

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true

#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0

# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security:
 #authorization: "enabled"

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

Mongodb version --> 4.0 Os --> ubuntu 16.04

Update-->

enter image description here

Was it helpful?

Solution

First, make sure the MongoDB service is running in the remote machine.

Next, check if the MongoDB port is open to the outside network or not.

The following will help you check if the 27017 is accessible from an outside machine.

nmap -Pn 13.56.140.11

If the port is not enabled, use the following command to expose the port.

sudo iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 27017 -j ACCEPT
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top