Today I present a guide so that in a few steps install MongoDB on our server with Ubuntu.
Feel free to read.
At the beginning we make an update repositories
apt-get update
Then we install MongoDB
apt-get install -y mongodb
Check the server status MongoDB command:
sudo systemctl status mongodb
the result of the:
● mongodb.service - An object/document-oriented database Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2018-05-26 07:48:04 UTC; 2min 17s ago Docs: man:mongod(1) Main PID: 2312 (mongod) Tasks: 23 (limit: 1153) CGroup: /system.slice/mongodb.service └─2312 /usr/bin/mongod --unixSocketPrefix=/run/mongodb --config /etc/mongodb.conf
Which indicates that the server is running correctly.
To confirm this connection we make a diagnostic command:
mongo --eval 'db.runCommand({ connectionStatus: 1 })'
We should get the result as below:
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.3
{
"authInfo" : {
"authenticatedUsers" : [ ],
"authenticatedUserRoles" : [ ]
},
"ok" : 1
If you use the firewall must add a port to exceptions in the case of UFW:
sudo ufw YOUR IP ADDRESS / 32 port e.g.: 27017
Command
sudo ufw status
This will allow us to verify whether a connection on this port is open:
Status: active To Action From -- ------ ---- OpenSSH ALLOW Anywhere 27017 ALLOW Anywhere OpenSSH (v6) ALLOW Anywhere (v6) 27017 (v6) ALLOW Anywhere (v6)
To allow remote connection, edit the file:/etc/mongodb.conf
nano /etc/mongodb.conf
And set:
...
logappend=true
bind_ip = 127.0.0.1,IP TWOJEGO SERWERA
#port = 27017
...
The guide below describes how to install KeePass on Ubuntu. Całość wykonamy za pomocą kilku poleceń…
Master PDF Editor is a comprehensive PDF program, which includes many features. Oprócz tworzenia i edycji…
Iotop jest prostym narzędziem dla systemów Uniksowych umożliwiającym monitorowanie użycia dowolnego nośnika pamięci flash/hdd/ssd w…
You can separate two or more commands with semicolons (;), Semicolon (;): służy do oddzielania…
Poniższy poradnik opisuje w jaki sposób za pomocą konsoli możemy dokonać edycji danych zdjęcia exif.…
The following guide describes how to install Rocket.Chat on Rocky Linux 8 Całość bardzo prosto zainstalujemy…