15 / 15
Feb 2023

I have been trying to set up MongoDB on my Mac using homebrew. I used MongoDB’s Documentation to do that, everything is installed correctly on my mac. But when I start the MongoDB services and try to run MongoDB manually as a background process I come across this error.

mongod --config /opt/homebrew/etc/mongod.conf --fork ─╯
about to fork child process, waiting until server is ready for connections.
forked process: 6558
ERROR: child process failed, exited with 48

And I cannot even access Mongo Shell , this is what I get

mongosh ─╯
[1] 7036 killed mongosh

@Fabio_Ramohitaj Hey !!

No Im unable to connect to the instance using mongo --port 27018 or mongosh --port 27018

here is the result:-

╭─    ~ ──────────────────────────────────────── KILL ✘  01:50:14 AM  ─╮ ╰─ mongo --port 27018 ─╯ zsh: command not found: mongo ╭─    ~ ───────────────────────────────────────── 127 ✘   ─╮ ╰─ mongosh --port 27018 ─╯ [1] 9058 killed mongosh --port 27018 ╭─    ~ ──────────────────────────────────────── KILL ✘   ─╮ ╰─

Regards!

Hello @Shahima_khan,

I just had the same issue and the problem for me was that I did not stop the services before running the ‘mongod --config /opt/hombrew/etc/mongod.conf --fork’ command. From reading the thread I believe your issue is the same.

Try running ‘brew services stop mongodb-community@{version}

Then run 'mongod --config /opt/hombrew/etc/mongod.conf --fork’.

Hope this helps!

Except for testing you do not want to start mongod manually with

You should use brew to stop and start since it is the safest way to get clean shutdown.

Closed on Feb 21, 2023

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