MacPorts ensures dependencies are installed correctly, and provides an easy way to upgrade all outdated. Although MongoDB binaries are available from the MongoDB web site, I strongly recommend using the MacPorts MongoDB port.
#Mongodb mac os x port number for mac os x#
If you have not passed specific port options like the ones above, then the mongod will be listening on 2707 ( http console) by default. MacPorts is a package manager for Mac OS X that makes it easy to install and configure a lot of open-source software. Open another instance of command prompt as administrator, navigate to MongoDB. You will see waiting for a connection on port 20000. Under the General tab, click the button to the right of the. Open command prompt as administrator, navigate to MongoDB installation directory’s bin folder then type mongod -dbpath 'C:Datadb' -port 20000. Here's an example: db.serverCmdLineOpts() Run MongoDB Community Edition Open System Preferences Select the Security and Privacy pane. That output will give you all the arguments passed on the command line (argv) and the ones from the config file (parsed) and you can infer the ports mongod is listening based on that information. However, assuming you only have access to the mongo shell (which your question title implies), then you can run the serverCmdLineOpts() command. If you choose to use a Linux or macOS system to host the database and you use the Repository installer to install it, MongoDBs limits for the number of open. From the system shell you can use lsof (see Derick's answer below) or netstat -an to view what a process is actually doing.