I am experiencing extreme slowness with mongo. Earlier when I put sudo systemctl status mongodb mongo I appeared Online and in green. Now after a few days he started to throw me away
mongodb.service - High-performance, schema-free document-oriented database
Loaded: loaded (/etc/systemd/system/mongodb.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-11-29 08:55:07 -03; 3 days ago
Process: 13231 ExecStart = / usr / bin / mongod --quiet --config /etc/mongod.conf (code = exited, status = 48)
Main PID: 13231 (code = exited, status = 48)
Nov 29 08:55:07 production-power systemd [1]: Started High-performance, schema-free document-oriented database.
Nov 29 08:55:07 production-power systemd [1]: mongodb.service: Main process exited, code = exited, status = 48 / n / a
Nov 29 08:55:07 production-power systemd [1]: mongodb.service: Unit entered failed state.
Nov 29 08:55:07 production-power systemd [1]: mongodb.service: Failed with result 'exit-code'.
This started to happen after an unexpected restart of Google VPS. I think it may be the cause of slowness. In any case, the mongo service is working, so write and read at the base normally nothing but slower. Anyone know how to solve the problem?
I got error code 48 when i tried to run mongodb.
Here is the output:
sudo service mongod status
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-12-31 13:15:04 +03; 33min ago
Docs: https://docs.mongodb.org/manual
Main PID: 18645 (code=exited, status=48)
Dec 31 13:15:03 cem systemd[1]: Started MongoDB Database Server.
Dec 31 13:15:04 cem systemd[1]: mongod.service: Main process exited, code=exited, status=48/n/a
Dec 31 13:15:04 cem systemd[1]: mongod.service: Failed with result 'exit-code'.
My solution was changing the default port, because this error occurs when the port for MongoDB is already in use.
Step 1: open conf file to edit.
sudo vim /etc/mongod.conf
Step 2: find port and change it.
net: port: 27017 -> default port before any change
After changing port, my issue solved :
sudo service mongod status
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2019-12-31 13:48:32 +03; 1s ago
Docs: https://docs.mongodb.org/manual
Main PID: 25254 (mongod)
CGroup: /system.slice/mongod.service
└─25254 /usr/bin/mongod --config /etc/mongod.conf
Dec 31 13:48:32 cem systemd[1]: Started MongoDB Database Server.
I hope this works for you.
Some ubuntu users have a problem with ports
Because the ports will run automatically when the OS opens!
If you have this issue, change the ports will not useful a lot! kill the port of mongod, as a default is => 27017
sudo kill -9 $(sudo lsof -t -i:27017)
then
sudo systemctl start mongod
sudo systemctl status mongod
It will return
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-17 09:47:31 EEST; 2s ago
Docs: https://docs.mongodb.org/manual
Main PID: 7119 (mongod)
Memory: 166.7M
CGroup: /system.slice/mongod.service
└─7119 /usr/bin/mongod --config /etc/mongod.conf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With