I'm running mongodb on a remote server and I want to access within my local machine
I've tried to remove the mongodb.lock file, also tried sudo mongod --repair but none of these worked for me.
This happens when I'm doing mongo <ip address>:27017/testDB or simply mongo <ip address>
I'm getting:
[js] Error: couldn't connect to server <ip address>:27017, connection attempt failed: SocketException: Error connecting to <ip address>:27017 :: caused by :: Connection refused :
connect@src/mongo/shell/mongo.js:344:17
@(connect):2:6
exception: connect failed
The mongo.cfg file looks like this:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: C:\Program Files\MongoDB\Server\4.0\data
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\4.0\log\mongod.log
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0
#processManagement:
#security:
authorization: 'enabled'
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp: