I installe mongodb following this tutorial https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-red-hat/ but this is the result of sudo systemctl status mongod
[root#ns1 ~]# sudo systemctl status mongod
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: failed (Result: signal) since Wed 2022-07-06 00:31:55 +03; 14min ago
Docs: https://docs.mongodb.org/manual
Process: 561243 ExecStart=/usr/bin/mongod $OPTIONS (code=killed, signal=ILL)
Process: 561241 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 561239 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
Process: 561238 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)
Jul 06 00:31:55 ns1.localhost.com systemd[1]: Starting MongoDB Database Server...
Jul 06 00:31:55 ns1.localhost.com systemd[1]: mongod.service: control process exited, code=killed status=4
Jul 06 00:31:55 ns1.localhost.com systemd[1]: Failed to start MongoDB Database Server.
Jul 06 00:31:55 ns1.localhost.com systemd[1]: Unit mongod.service entered failed state.
Jul 06 00:31:55 ns1.localhost.com systemd[1]: mongod.service failed.
journalctl -xe
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/multiseat
--
-- A new session with the ID c15063 has been created for the user root.
--
-- The leading process of the session is 561230.
Jul 06 00:31:55 ns1.localhost.com sudo[561230]: pam_unix(sudo:session): session opened for user root by root
Jul 06 00:31:55 ns1.localhost.com polkitd[458]: Registered Authentication Agent for unix-process:561232:1926
Jul 06 00:31:55 ns1.localhost.com systemd[1]: Starting MongoDB Database Server...
-- Subject: Unit mongod.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has begun starting up.
Jul 06 00:31:55 ns1.localhost.com kernel: traps: mongod[561243] trap invalid opcode ip:55b5947535da sp:7ffd0
Jul 06 00:31:55 ns1.localhost.com systemd[1]: mongod.service: control process exited, code=killed status=4
Jul 06 00:31:55 ns1.localhost.com systemd[1]: Failed to start MongoDB Database Server.
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has failed.
--
-- The result is failed.
Jul 06 00:31:55 ns1.localhost.com systemd[1]: Unit mongod.service entered failed state.
Jul 06 00:31:55 ns1.localhost.com systemd[1]: mongod.service failed.
Jul 06 00:31:55 ns1.localhost.com polkitd[458]: Unregistered Authentication Agent for unix-process:561232:19
Jul 06 00:31:55 ns1.localhost.com sudo[561230]: pam_unix(sudo:session): session closed for user root
Jul 06 00:31:55 ns1.localhost.com systemd-logind[459]: Removed session c15063.
-- Subject: Session c15063 has been terminated
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Related
I added some files to systemed folder on my CentOS, after that postgresql service can not start with the error -
Job for postgresql-14.service failed because the control process exited with error code. See "systemctl status postgresql-14.service" and "journalctl -xe" for details.
systemctl status -
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: Starting PostgreSQL 14 database server...
Feb 08 20:47:38 82-166-106-208.barak-online.net postmaster[2525]: 2023-02-08 20:47:38.805 IST [2525] LOG: redirecting log output to logging collector process
Feb 08 20:47:38 82-166-106-208.barak-online.net postmaster[2525]: 2023-02-08 20:47:38.805 IST [2525] HINT: Future log output will appear in directory "log".
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: postgresql-14.service: main process exited, code=exited, status=1/FAILURE
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: Failed to start PostgreSQL 14 database server.
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: Unit postgresql-14.service entered failed state.
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: postgresql-14.service failed.
journalctl -xe
-- Unit postgresql-14.service has begun starting up.
Feb 08 20:47:38 82-166-106-208.barak-online.net postmaster[2525]: 2023-02-08 20:47:38.805 IST [2525] LOG: redirecting log output to logging collector process
Feb 08 20:47:38 82-166-106-208.barak-online.net postmaster[2525]: 2023-02-08 20:47:38.805 IST [2525] HINT: Future log output will appear in directory "log".
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: postgresql-14.service: main process exited, code=exited, status=1/FAILURE
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: Failed to start PostgreSQL 14 database server.
-- Subject: Unit postgresql-14.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-14.service has failed.
--
-- The result is failed.
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: Unit postgresql-14.service entered failed state.
Feb 08 20:47:38 82-166-106-208.barak-online.net systemd[1]: postgresql-14.service failed.
Feb 08 20:47:38 82-166-106-208.barak-online.net polkitd[774]: Unregistered Authentication Agent for unix-process:2512:147782 (system bus name :1.40, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_IN
lines 2104-2163/2163 (END)
Appears to be an authentication error, check this out https://www.sqlshack.com/learn-postgresql-install-postgresql-on-centos-linux/
Tried running mongodb on my ubuntu 20.04
sudo systemctl start mongodb
in the shell returns -
Job for mongodb.service failed because the control process exited with error code.
See "systemctl status mongodb.service" and "journalctl -xe" for details.
And sudo systemctl status mongodb returns -
● mongodb.service - LSB: An object/document-oriented database
Loaded: loaded (/etc/init.d/mongodb; generated)
Active: failed (Result: exit-code) since Fri 2022-03-04 11:18:53 IST; 2s ago
Docs: man:systemd-sysv-generator(8)
Process: 82695 ExecStart=/etc/init.d/mongodb start (code=exited, status=1/FAILURE)
Mar 04 11:18:52 hp systemd[1]: Starting LSB: An object/document-oriented database...
Mar 04 11:18:52 hp mongodb[82695]: * Starting database mongodb
Mar 04 11:18:53 hp mongodb[82695]: ...fail!
Mar 04 11:18:53 hp systemd[1]: mongodb.service: Control process exited, code=exited, status=1/FAILURE
Mar 04 11:18:53 hp systemd[1]: mongodb.service: Failed with result 'exit-code'.
Mar 04 11:18:53 hp systemd[1]: Failed to start LSB: An object/document-oriented database.
what do I do?
I'm trying to create a systemd service on CentOS 7.5, to acces livestatos from remote thru
File proxy-to-livestatus.service:
[Unit]
Requires=naemon.service
After=naemon.service
[Service]
ExecStart=/usr/lib/systemd/systemd-socket-proxyd /run/naemon/live
File proxy-to-livestatus.socket:
[Unit]
StopWhenUnneeded=true
[Socket]
ListenStream=6557
Status:
systemctl status proxy-to-livestatus.service
● proxy-to-livestatus.service
Loaded: loaded (/etc/systemd/system/proxy-to-livestatus.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since mié 2018-07-18 09:11:58 CEST; 15s ago
Process: 3203 ExecStart=/usr/lib/systemd/systemd-socket-proxyd /run/naemon/live (code=exited, status=1/FAILURE)
Main PID: 3203 (code=exited, status=1/FAILURE)
jul 18 09:11:58 chuwi systemd[1]: Started proxy-to-livestatus.service.
jul 18 09:11:58 chuwi systemd[1]: Starting proxy-to-livestatus.service...
jul 18 09:11:58 chuwi systemd-socket-proxyd[3203]: Didn't get any sockets passed in.
jul 18 09:11:58 chuwi systemd[1]: proxy-to-livestatus.service: main process exited, code=exited, status=1/FAILURE
jul 18 09:11:58 chuwi systemd[1]: Unit proxy-to-livestatus.service entered failed state.
jul 18 09:11:58 chuwi systemd[1]: proxy-to-livestatus.service failed.
Hi to resolve this issue, we haver to enable the socket with --now option
systemctl enable --now proxy-to-livestatus.socket
and the start the proxy-to-livestatus.service
systemctl start systemctl enable --now proxy-to-livestatus.socket
Regards
When i tape this command to show the status of mongodb
sudo service mongod status
i have this error output
● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-07-06 12:57:03 CEST; 3min 52s ago
Docs: https://docs.mongodb.org/manual
Process: 6233 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=100)
Main PID: 6233 (code=exited, status=100)
Jul 06 12:57:03 ns3067256.ip-94-23-35.eu systemd[1]: Started High-performance, schema-free document-oriented database.
Jul 06 12:57:03 ns3067256.ip-94-23-35.eu mongod[6233]: 2017-07-06T12:57:03.090+0200 I CONTROL [main] WARNING: Cannot detect if NUMA interleaving is enabled. Failed to pr
Jul 06 12:57:03 ns3067256.ip-94-23-35.eu systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Jul 06 12:57:03 ns3067256.ip-94-23-35.eu systemd[1]: mongod.service: Unit entered failed state.
Jul 06 12:57:03 ns3067256.ip-94-23-35.eu systemd[1]: mongod.service: Failed with result 'exit-code'.
so what is the solution !?
Go to /etc/mongod.conf and look for dbPath: /xyz/xyz
Use the following command to provide the rights to mongodb
sudo chown -R mongodb:mongodb /xyz/xyz
I am trying to setup a demo replicaset from standalone MongoDB in MongoDB 3.2 with the following options in mongod.conf:
#replication:
oplogSizeMB: 10240
replSetName: "rs0"
But when I am trying to start mongodb it is throwing error:
Starting mongod (via systemctl): Job for mongod.service failed because the control process exited with error code. See "systemctl status mongod.service" and "journalctl -xe" for details. [FAILED]
output of journalctl -xe says:
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database....
-- Subject: Unit mongod.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has begun starting up.
Jul 02 07:53:56 smartJN3-LTest-Blr1 runuser[29989]: pam_unix(runuser:session): session opened for user mongod by (uid=0)
Jul 02 07:53:56 smartJN3-LTest-Blr1 runuser[29989]: pam_unix(runuser:session): session closed for user mongod
Jul 02 07:53:56 smartJN3-LTest-Blr1 mongod[29982]: Starting mongod: [FAILED]
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: mongod.service: control process exited, code=exited status=1
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database..
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mongod.service has failed.
--
-- The result is failed.
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: Unit mongod.service entered failed state.
Jul 02 07:53:56 smartJN3-LTest-Blr1 systemd[1]: mongod.service failed.
Jul 02 07:53:56 smartJN3-LTest-Blr1 polkitd[2089]: Unregistered Authentication Agent for unix-process:29977:8668980 (system bus name :1.114, object path /org
This is on CentOS 7.2 . Thanks
Anyone any help. Thanks
fixed it myself. stupid me, I didn't uncomment the section header replication, which is why the settings were never picked.