Here are the logs for my mongodb status which show in it is in running status
ubuntu#ip-172-31-9-130:/etc$ sudo service mongod status
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset:
Active: active (running) since Fri 2018-09-28 09:50:43 UTC; 37min ago
Docs: https://docs.mongodb.org/manual
Main PID: 28315 (mongod)
CGroup: /system.slice/mongod.service
└─28315 /usr/bin/mongod --config /etc/mongod.conf
Sep 28 09:50:43 ip-172-31-9-130 systemd[1]: Started MongoDB Database Server.
Sep 28 09:50:43 ip-172-31-9-130 mongod[28315]: 2018-09-28T09:50:43.848+0000 I CO
lines 1-10/10 (END)
But when I connect it with robomongo it throws error
Failed to connect to the server
Please help!!!
Related
I'm trying to use an external drive to store my mongo collections. As per this question, I changed dbPath in /etc/mongod.conf from /var/lib/mongodb to /media/user/drive/mongodb. I also chown'd the new path to the mongodb user.
However, when I sudo service start mongod, I cannot start the server:
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2022-12-07 22:27:09 CET; 2s ago
Docs: https://docs.mongodb.org/manual
Process: 63819 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 63819 (code=exited, status=100)
Dec 07 22:27:09 user-ThinkPad-T480s systemd[1]: Started MongoDB Database Server.
Dec 07 22:27:09 user-ThinkPad-T480s systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Dec 07 22:27:09 user-ThinkPad-T480s systemd[1]: mongod.service: Failed with result 'exit-code'.
When I change dbPath back to /var/lib/mongodb it starts again. How can I fix this such that I can use the path on my external drive?
Not sure which OS you run and which version of MongoDB.
On Amazon Linux 2 it's mongod user not mongodb for MongoDB-5.0
Make sure you ran chown with -R flag
-rw-r----- 1 mongod mongod 8.6M Dec 10 00:59 mongod.log
Also check logs for more hints, default location should be under
/var/log/mongodb/mongod.log
I currently have MongoDB 4.4 installed, as my system does not support 5.0. I have previously had 4.4 installed on Arch Linux, however when I moved over to Ubuntu and tried to run mongod, I get this result from systemd:
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: signal) since Fri 2021-12-10 15:57:00 CST; 2min 3s ago
Docs: https://docs.mongodb.org/manual
Process: 4369 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=killed, signal=ILL)
Main PID: 4369 (code=killed, signal=ILL)
Dec 10 15:57:00 system systemd[1]: Started MongoDB Database Server.
Dec 10 15:57:00 system systemd[1]: mongod.service: Main process exited, code=killed, status=4/ILL
Dec 10 15:57:00 system systemd[1]: mongod.service: Failed with result 'signal'.
MongoDB fails before logs can be created.
While this doesn't completely solve the issue, I'm fine with this resolution:
For whatever reason, 4.2 works fine, but 4.4 doesn't, even though I was completely fine running 4.4 on Arch.
mongoDB compass doesn't work!
installed on this site
before that there was also a problem, I had to reinstall ubuntu in Russian
[23114:0923/070140.222706:FATAL:gpu_data_manager_impl_private.cc(894)] The display compositor is frequently crashing. Goodbye.
Additional Information
sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor>
Active: active (running) since Thu 2021-09-23 06:44:41 EEST; 18s ago
Docs: https://docs.mongodb.org/manual
Main PID: 18125 (mongod)
Memory: 60.7M
CPU: 685ms
CGroup: /system.slice/mongod.service
└─18125 /usr/bin/mongod --config /etc/mongod.conf
sep 23 06:44:41 d991 systemd[1]: Started MongoDB Database Server.
I am working on EC2 aws. My mongo suddenly stopped connecting.
sudo service mongodb status displays the following:-
● mongodb.service - High-performance, schema-free document-oriented >database
Loaded: loaded (/etc/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-03-29 18:31:08 UTC; 1h 18min ago
Main PID: 3773 (code=exited, status=100)
Mar 29 18:31:07 ip-172-31-41-39 systemd[1]: Started An object/document-oriented database.
Mar 29 18:31:08 ip-172-31-41-39 systemd[1]: mongodb.service: Main process exited, code=exited, status=100/n/a
Mar 29 18:31:08 ip-172-31-41-39 systemd[1]: mongodb.service: Failed with result 'exit-code'.
I read that doing sudo service mongodb start might solve your problem but I fear will it delete my data?
An exit code 100 for the mongodb service means that it could not access or find the data directory. If your data directory is protected by sudo then starting the service with sudo will solve your problem.
I just installed MongoDB v4.0.2 and after I try to start the service:
sudo systemctl start mongodb
and then get its status:
sudo systemctl status mongodb
I get this:
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 2018-09-21 15:00:05 UTC; 1s ago
Process: 3460 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=100)
Main PID: 3460 (code=exited, status=100)
What's happening?
EDIT: I STORAGE [initandlisten] exception in initAndListen: DBPathInUse: Unable to lock the lock file: /var/lib/mongodb/mongod.lock (Unknown error). Another mongod instance is already running on the /var/lib/mongodb directory, terminating