I have a docker container that has Rails and mongoDB running in it.
I set the mongo configuration to use a unix socket for the connection because the only resource that really needs to connect to it (the rails app) is running in the container.
Whenever I try to connect to the mongo shell I get this error:
[main] Error: network error while attempting to run command 'isMaster' on host '127.0.0.1:27017'
I have my mongoDB configuration set up like this:
#mongod.conf - 3.4
storage:
dbPath: "/var/lib/mongodb"
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: "/var/log/mongodb/mongodb.log"
logAppend: true
timeStampFormat: iso8601-utc
processManagement:
fork: true
net:
bindIp: 127.0.0.1
port: 27017
wireObjectCheck: false
unixDomainSocket:
enabled: true
net:
ssl:
mode: requireSSL
PEMKeyFile: /etc/ssl/certs/db/mongodb.pem
security:
authorization: enabled
Has anyone else run into this issue as well? Is there a best practice on mongoDB configuration within docker containers?