Skip to content

Instantly share code, notes, and snippets.

@alaztetik
Created June 6, 2022 20:01
Show Gist options
  • Save alaztetik/650d2b8698ecb53a1c529cc56bc320e1 to your computer and use it in GitHub Desktop.
Save alaztetik/650d2b8698ecb53a1c529cc56bc320e1 to your computer and use it in GitHub Desktop.
How to run mongod (server) and mongo/mongos shell on Linux
# start the server:
mongod --dbpath /path/to/data/to/be/stored --logpath /log/path/mongo.log

# enter the shell:
mongo
# or
mongos
@alaztetik
Copy link
Author

If there is a problem (a failed connection) try this:

sudo rm -rf /tmp/mongodb-27017.sock

sudo service mongod start

Credit

@alaztetik
Copy link
Author

alaztetik commented Jun 16, 2022

You can specify a port number:

sudo mongod --port 27018

and open a shell on that port:

mongo --port 27018

@alaztetik
Copy link
Author

On Manjaro / Arch, it now uses openssl-1.3, but MongoDB still requires 1.1.

So there is now a dependency problem.

Started MongoDB Database Server.
/usr/bin/mongod: error while loading shared libraries: libcrypto.so.1.1: cannot open shared object file: No such file or directory
mongodb.service: Main process exited, code=exited, status=127/n/a
mongodb.service: Failed with result 'exit-code'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment