forked from ferryastika/MataElang-Platform
-
Notifications
You must be signed in to change notification settings - Fork 1
4. MongoDB
Fadhil Yori Hibatullah edited this page Mar 5, 2020
·
2 revisions
Source : https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
- Import MongoDB Repository Key
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
- Add MongoDB Ubuntu Repository
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee -a /etc/apt/sources.list.d/mongodb-org-4.2.list
- Update APT index
$ sudo apt update
- Install MongoDB
$ sudo apt-get install mongodb-org
- Enable Mongo Service
$ sudo systemctl enable mongod.service
- Start Mongo Service
$ sudo systemctl start mongod.service
- Configuring MongoDB, edit
/etc/mongod.conf
file, change the following section like below:
net:
port: 27017
bindIp: 0.0.0.0
...
security:
authorization: 'enabled'
...
replication:
replSetName: rs0
- Restart Mongo Service
$ sudo systemctl restart mongod.service