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
Hi @Shahima_khan ,
Can you display your configuration file please?
I think it Is set internally the fork option so you don’ t need to explicate the --fork option from the Shell.
(P.S. everything was up to date before starting this process)
brew tap mongodb/brew
brew install mongodb-community@6.0
brew services start mongodb-community@6.0
Then I checked if the services are running using this command
brew services list
I get the following output:-
brew services list ─╯
Name Status User File
emacs none
mongodb-community started shahima ~/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
unbound none
So according to the output, MongoDB is running
when I try to get the version of MongoDB after closing the current terminal window using the command
I did as u asked but I got a bunch of logs in my terminal.
I changed the port to 27018 in the editor and then after saving the file I restarted the mongodb server using the command
brew services restart mongodb-community
(I hope this is what u mean by restarting the process. Pls correct me if I’m wrong)
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.