ps is an os command
I think you ran it at mongo prompt which gave syntax error
exit from mongo prompt and run the command from your os prompt i,e $ or # as the case
Yes it is confusing for a beginner but that’s how you learn explore and experiment
ok, I exited and it said
000 00000 00000[number] 0 11:27AM ttys000 0:00.01 grep mongod
Is there a place I can go to look to see what these codes mean? -ef|grep mongod.
I don’t think that is mongod specific right?
after I checked this I tried typing mongod and it errored again. Could you help me get this running again so I can start on some beginner tutorials for mongod and console stuff.
Thanks,
nvm about the codes. I thought it was mongodb specific but I learned that it is commands for the Mac terminal. I am trying to learn about that while I wait for your help.
Hi @base_az,
If you’d like a faster way to get started learning MongoDB, I suggest creating a MongoDB Atlas free tier cluster. That will give you a development environment with 512MB of storage (data + index size).
If you prefer to install locally, I would follow the tutorial to Install MongoDB Community Edition on macOS and manage your local MongoDB service using brew
. The brew
package includes a service definition which makes it easier to Run MongoDB.
The brew
installation creates all of the directories needed with the correct permissions and includes a configuration file where you can change any options (for example, the port
the process listens on).
With brew you would use:
brew services start mongodb-community
brew services stop mongodb-community
Regards,
Stennie
hi Stennie,
This is what I did originally with a quick tutorial. Everything worked fine till I started the 2nd project and everything broke. I kept getting errors and it would not let me load up mongodb. I just just started so I have no clue how to fix it so Ramachandra has been patiently helping me get everything running again. Not quite there but hopefully soon I will be back up and running again.
I have been doing a lot of reading and I think it is something with the Big Sur OS update from like 8 months ago or longer. I am having similar issues as what some of the people are mentioning about it. It stopped working around the time I updated my computer. I usually wait a while before the update comes out before updating. Going to research that a little bit more.
Hi @base_az,
What version of macOS were you using before Big Sur? If you upgraded from something older than Catalina, the most likely issue is that the root directory is now protected by macOS so mongod
cannot use the default /data/db
path if a configuration file or --dbpath
value isn’t provided.
However, if you installed via brew
the recipe already takes care of this and you should be fine starting and stopping via brew services
.
If you need more details about your local brew
configuration, try: brew info mongodb-community
.
Regards,
Stennie
You should not type mongod
mongod is used to start a mongod instance
You should use mongo to connect to your mongod
I am assuming the mongod which you have started on port 28000 is still up and running
Just issue mongo --port 28000 to connect to it
In case it is down (terminated or shutdown) you can start it again from command line using all required params
mongod --port 28000 --dbpath your_path --logpath your_path/mongod.log
Here your_path means /Users/yourname/test
mongod command will work provided you give a valid dbpath
As Stennie mentioned access to /data/db is removed in macOS
I mentioned this point in one of my replies above