Error running mongodb as service on Centos 7 - mongodb

I've got a VPS with Centos 7, But when I try to run MongoDB as service I get the following message:
Apr 06 03:11:46 server.backupserver.com systemd[1]: Starting MongoDB Database Server...
Apr 06 03:11:46 server.backupserver.com mongod[3767]: about to fork child process, waiting until server is ready for connections.
Apr 06 03:11:46 server.backupserver.com mongod[3767]: forked process: 3769
Apr 06 03:11:49 server.backupserver.com systemd[1]: Can't open PID file /var/run/mongodb/mongod.pid (yet?) after start: Too many levels of symbolic links
Apr 06 03:13:17 server.backupserver.com systemd[1]: mongod.service start operation timed out. Terminating.
Apr 06 03:13:17 server.backupserver.com systemd[1]: Failed to start MongoDB Database Server.
Apr 06 03:13:17 server.backupserver.com systemd[1]: Unit mongod.service entered failed state.
Apr 06 03:13:17 server.backupserver.com systemd[1]: mongod.service failed.
I tested the responses from another topics, but it doesn't work yet.
The "var/run/mongodb" directory and the file "mongod.pid" has the right permissions and user (mongod).
Please, help

This seems to be a message that systemd can produce under a variety of conditions. To troubleshoot:
Start with a pristine Docker, Vagrant, VirtualBox etc. image of CentOS 7.
Follow the official MongoDB installation instructions.
If you succeed, follow the official installation instructions on your VPS.

Related

Mongodb will not start. libboost_filesystem.so.1.78.0: cannot open shared object file: No such file or directory

Something must be broken, or maybe there is something I am not seeing.
I do:
sudo systemctl status mongodb.service
But I get this error:
Jan 26 10:47:49 MacBookPro systemd[1]: Starting MongoDB Database Server...
Jan 26 10:47:49 MacBookPro mongod[12272]: /usr/bin/mongod: error while loading shared libraries: libboost_filesystem.so.1.78.0: cannot>
Jan 26 10:47:49 MacBookPro systemd[1]: mongodb.service: Control process exited, code=exited, status=127/n/a
Jan 26 10:47:49 MacBookPro systemd[1]: mongodb.service: Failed with result 'exit-code'.
Jan 26 10:47:49 MacBookPro systemd[1]: Failed to start MongoDB Database Server.
I have been reading: https://wiki.archlinux.org/title/MongoDB
And because there is no mongod.lock file I do:
mongod --dbpath /var/lib/mongodb/ --repair
But the error persists:
mongod: error while loading shared libraries: libboost_filesystem.so.1.78.0: cannot open shared object file: No such file or directory
What do you guys think is happening? Thanks in advance. Btw I am using BlackArch.
I have tried a full update and upgrade. My system says it is fully updated, but maybe it is not?

MongoDB keeps crashing--is it running out of memory or CPU?

I have an issue where MongoDB keeps crashing on me:
$ sudo cat /var/log/syslog ->
Nov 28 14:06:58 ns557017 systemd[1]: mongod.service: Main process exited, code=killed, status=6/ABRT
Nov 28 14:06:58 ns557017 systemd[1]: mongod.service: Unit entered failed state.
Nov 28 14:06:58 ns557017 systemd[1]: mongod.service: Failed with result 'signal'.
Nov 28 14:06:59 ns557017 systemd[1]: mongod.service: Service hold-off time over, scheduling restart.
Nov 28 14:06:59 ns557017 systemd[1]: Stopped MongoDB Database Server.
I am using Mongo's free monitoring, and it points me towards the CPU being overused:
However if I look at htop, the CPU always seems fine:
How can I deduce what is causing Mongo to crash on me? Thanks

Slapd won't start via service

Doing sudo service slapd start throws an error:
-- Unit slapd.service has begun starting up.
Apr 08 08:47:31 mail slapd[31144]: * Starting OpenLDAP slapd Apr 08
08:47:32 mail slapd[31149]: #(#) $OpenLDAP: slapd (Ubuntu) (May 30
2017 19:20:53)
$buildd#lgw01-18:/build/openldap-JXEADB/openldap-2.4.42+dfsg/debian/build/se
Apr 08 08:47:32 mail slapd[31149]: DIGEST-MD5 common mech free
Apr 08 08:47:32 mail slapd[31144]: ...fail!
Apr 08 08:47:32 mail systemd[1]: slapd.service: Control process exited,
code=exited status=1
Apr 08 08:47:32 mail systemd[1]: Failed to start LSB:
OpenLDAP standalone server (Lightweight Directory Access Protoco
-- Subject: Unit slapd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit slapd.service has failed.
-- The result is failed.
Apr 08 08:47:32 mail systemd[1]: slapd.service: Unit entered failed state.
Apr 08 08:47:32 mail systemd[1]: slapd.service: Failed with result 'exit-code'.
I did check directory permissions. Fine.
Starting sudo -u openldap slapd -d 1 is working fine, no errors thrown.
Any ideas why it won't start? The journalctl output is not helpful what exactly the error is.

Getting "mongod: command not found". Analysis found that rpm is getting deleted

I am evaluating mongodb Enterprise version. I have it running in a RedHat Linux OS. Things were going good till mongod command stopped working suddenly. Our unix admins replied that rpm is getting deleted.
Here is the information i got from admins Any idea on this?
Oct 23 15:39:20 systemd[1]: [/usr/lib/systemd/system/mongod.service:27] Unknown lvalue 'TasksMax' in section 'Service'
Oct 23 15:39:20 systemd[1]: [/usr/lib/systemd/system/mongod.service:28] Unknown lvalue 'TasksAccounting' in section 'Service'
Oct 23 15:39:20 systemd[1]: Started Flexible Branding Service.
Oct 23 15:39:20 systemd[1]: Starting Flexible Branding Service...
Oct 23 15:39:20 yum[93405]: Erased: mongodb-enterprise-server-3.4.9-1.el7.x86_64
Oct 23 15:39:20 yum[93405]: Erased: 1:net-snmp-5.7.2-28.el7.x86_64
Oct 23 15:39:20 systemd[1]: Reloading.
Oct 23 15:39:20 systemd[1]: Started Flexible Branding Service.
Oct 23 15:39:20 systemd[1]: Starting Flexible Branding Service... "
Appreciate your help.
Thanks,
Harin
The systemd introduced this TasksMax setting in version 226
You need to check your version SYSTEMD
sudo systemd --version or sudo systemctl --version
If you systemd is old that the above you need to update link to update systemd
https://linoxide.com/linux-how-to/install-systemd-centos-redhat/
Try this: Set the SELINUX variable in the /etc/selinux/config file like follows:
SELINUX = disabled
Then restart MongoDB.
regards,

Mongodb fails to start -> presents weird error logs

When I moved my environment from my local (mac) to my server (ubuntu) I unzipped my directory and the server installed with npm install with no errors or warnings, but my database was failing so I decided to reinstall it based on this tutorial (well, apt-remove mongo* first)
https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
but then I get a
Job for mongodb.service failed because the control process exited with error code. See "systemctl status mongodb.service" and "journalctl -xe" for details.
Does anyone know what any of this means?
-- Unit mongodb.service has begun starting up.
Jun 20 03:54:18 ip-172-31-16-163 mongodb[25271]: * Starting database mongodb
Jun 20 03:54:19 ip-172-31-16-163 mongodb[25271]: ...fail!
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Control process exited, code=exited status=1
Jun 20 03:54:19 ip-172-31-16-163 sudo[25268]: pam_unix(sudo:session): session closed for user root
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: Failed to start LSB: An object/document-oriented database.
-- Subject: Unit mongodb.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongodb.service has failed.
--
-- The result is failed.
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Unit entered failed state.
Jun 20 03:54:19 ip-172-31-16-163 systemd[1]: mongodb.service: Failed with result 'exit-code'.
Looks familiar. Check ownership of files. Files in dbPath, mongod.run -lock file, keyfile...
Basically all those files what are listed at your /etc/mongod.conf
Run the following command and Its works for me
sudo apt-get install --reinstall mongodb