Running Errors for mongo/d on Mac High Sierra

I’m a student trying to run mongodb on my Mac High Sierra 10.13.6. My mongodb version is v4.4.21. When I try to run mongo/mongod I get the following errors for each.

When I try to run mongo this is the error I get:

Book-Pro:~ aerodynamictapeworm$mongo
MongoDB shell version V4.4.21
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName
=mongodb
Error: couldn’t connect to server 127.0.0.1:27017,
connection attempt failed: Socketexception: error connecting to 127.0.0.1:27017 :: caused by :: connection refused:
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed exiting with code

When I try to run mongod, I get a very long list of processes, as if it’s starting up, but then I get the following message, and it shuts the program down again (snippet):

Here is the configuration:

systemLog:
destination: file path: /us/local/var/log/mongodb/mongo. log logAppend: true
storage:
dbPath: /usr/local/var/mongodb
net:
bindIp: 127.0.0.1, ::1
IPv6: true

Data directory /data/db not found.

The error above is most likely what is causing the mongod instance to terminate upon starting.

What is the actual / full mongod command you’re using to start up the mongod instance? From the error, it looks like there is no /data/db directory found for the data directory. I understand you’ve specified the configuration file contents which contains a different dbPath value so I assume you’ve started the mongod instance without the configuration file - To learn more on using the configuration file please see the following Configuration File Options documentation.

Regards,
Jason

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.