![]() Now check that MongoDB has been started on port 27017 with the netstat command. As you might have noticed, the MongoDB server by default, starts listening on TCP port 27017 on all interfaces. As soon as the repository was enabled, install the mongodb-org meta-package by typing the following command. Save and exit Reload System Service sudo service mongod restart We downloaded a precompiled binary package and started the mongod server using the most basic command line parameter -dbpath so that it uses a customized directory, /data/db for storing databases. To make it easy for the APT to find the whereabouts of mongodb-org package, update your server’s local package index. In this file you will see a a line like thisĮxecStart=/usr/bin/mongod - config /etc/nfĮxecStart=/usr/bin/mongod - auth - config /etc/nf ![]() Start MongoDB and add it as a service to be started at boot time sudo systemctl daemon-reloadĬonfigure MongoDB username and password export LC_ALL=Cĭb.createUser()Įxit out of mongo client using Ctrl+C Enable mongodb authentication sudo vim /lib/systemd/system/rvice ![]() Installing MongoDB sudo apt-get install -y mongodb-org -allow-unauthenticated Replace 3.4 with the version you want for mongo Update the repository sudo apt-get update Importing the Public Key sudo apt-key adv -keyserver hkp://:80 -recv 7F0CEB10Ĭreate source list file MongoDB echo "deb "$(lsb_release -sc)"/mongodb-org/3.4 multiverse" | sudo tee /etc/apt//mongodb-org-3.4.list ![]() I will try to set up MongoDb server on EC2. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
August 2023
Categories |