Hello!
I’m just starting MongoDB, so i need a lot of help.
Now, I’m setting ‘net.bindIp’ in mongodb.conf, but it doesn’t seem like it.
I know that ‘net.bindIp’ determines what ip to access DB like AWS’s inbound setting.
So, I did various tests.
- net.bindIp : localhost.
- mongod -f /etc/mongod.conf is well
- But, MongoDB Compass cannot access to DB.
- net.bindIp : instance IP(this is aws instance private ip. hostname -I command result).
- mongod -f /etc/mongod.conf is well
- And, MongoDB Compass can access to DB well.
- net.bindIp : my computer IP
- mongod -f /etc/mongod.conf is error(Error: 48)
Below is error content.
about to fork child process, waiting until server is ready for connections.
forked process: 29977
ERROR: child process failed, exited with error number 48
To see additional information in this output, start without the "--fork" option.
So, I have a few questions.
-
Why can’t I connect ‘bindIP : localhost’ with MongoDB Comapss when I can connect ‘bindIp : instance IP’ with MongoDB Compass?
-
Why can’t I set my computer IP with net.bindIp?
Below is my mongod.conf setting, and my MongoDB version is v4.2.6
I just modified ‘net’ and ‘security’.
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27017
bindIp: localhost # I tested this.(localhost, instance ip, my computer ip)
security:
authorization: enabled
javascriptEnabled: false
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
Thank you!