0

I've tried this on CentOS 7 and 8 and I'm getting the same result. Also tried with different versions of MongoDB. I'm trying to run a Pritunl VPN on a hyper-v VM and have followed this tutorial for installing mongodb and this tutorial for setting everything up with the exception that I'm using a VM rather than a VPS.

When I run "systemctl start mongod" I get the error "Job for mongod.service failed because a fatal signal was delivered causing the control process to dump core. See "systemctl status mongod.service" and "journalctl -xe" for details."

Running journalctl -xe yields something along the lines of the code included below. I tried disabling core dump and the "Process" number changed from 3397 to 4143. Also included the output of systemctl status mongod.service.

This is my first time working with something like this so there's a high possibility I'm missing something simple. I keep seeing mention of directory files in some of the solution posts but according to the mongodb install instructions it should create it's own directories. Any help is appreciated because I am beyond lost.

journalctl -xe:

    -- Unit mongod.service has begun starting up.
Dec 22 14:54:12 localhost.localdomain kernel: traps: mongod[33894] trap invalid opcode ip:558aaaedaeda sp:7ffd3f5a6560 error>
Dec 22 14:54:12 localhost.localdomain systemd[1]: Started Process Core Dump (PID 33895/UID 0).
-- Subject: Unit systemd-coredump@8-33895-0.service has finished start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit systemd-coredump@8-33895-0.service has finished starting up.
--
-- The start-up result is done.
Dec 22 14:54:12 localhost.localdomain systemd-coredump[33896]: Resource limits disable core dumping for process 33894 (mongo>
Dec 22 14:54:12 localhost.localdomain systemd-coredump[33896]: Process 33894 (mongod) of user 974 dumped core.
-- Subject: Process 33894 (mongod) dumped core
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
-- Documentation: man:core(5)
--
-- Process 33894 (mongod) crashed and dumped core.
--
-- This usually indicates a programming error in the crashing program and
-- should be reported to its vendor as a bug.
Dec 22 14:54:12 localhost.localdomain systemd[1]: mongod.service: Control process exited, code=dumped status=4
Dec 22 14:54:12 localhost.localdomain systemd[1]: mongod.service: Failed with result 'core-dump'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit mongod.service has entered the 'failed' state with result 'core-dump'.
Dec 22 14:54:12 localhost.localdomain systemd[1]: Failed to start MongoDB Database Server.
-- Subject: Unit mongod.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit mongod.service has failed.
--
-- The result is failed.
Dec 22 14:54:12 localhost.localdomain systemd[1]: systemd-coredump@8-33895-0.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit systemd-coredump@8-33895-0.service has successfully entered the 'dead' state.

status of mongod.service:


    ● mongod.service - MongoDB Database Server
   Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
   Active: failed (Result: core-dump) since Wed 2021-12-22 14:54:12 EST; 5min ago
     Docs: https://docs.mongodb.org/manual
  Process: 33894 ExecStart=/usr/bin/mongod $OPTIONS (code=dumped, signal=ILL)
  Process: 33892 ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 33890 ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb (code=exited, status=0/SUCCESS)
  Process: 33888 ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb (code=exited, status=0/SUCCESS)

Dec 22 14:54:12 localhost.localdomain systemd[1]: Starting MongoDB Database Server...
Dec 22 14:54:12 localhost.localdomain systemd-coredump[33896]: Process 33894 (mongod) of user 974 dumped core.
Dec 22 14:54:12 localhost.localdomain systemd[1]: mongod.service: Control process exited, code=dumped status=4
Dec 22 14:54:12 localhost.localdomain systemd[1]: mongod.service: Failed with result 'core-dump'.
Dec 22 14:54:12 localhost.localdomain systemd[1]: Failed to start MongoDB Database Server.

mongod.conf:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: /var/lib/mongo
  journal:
    enabled: true
#  engine:
#  wiredTiger:

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile
  timeZoneInfo: /usr/share/zoneinfo

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1  # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.


#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options

#auditLog:
"/etc/mongod.conf" 44L, 830C

mongod.service:

[Unit]
Description=MongoDB Database Server
Documentation=https://docs.mongodb.org/manual
After=network-online.target
Wants=network-online.target

[Service]
User=mongod
Group=mongod
Environment="OPTIONS=-f /etc/mongod.conf"
EnvironmentFile=-/etc/sysconfig/mongod
ExecStart=/usr/bin/mongod $OPTIONS
ExecStartPre=/usr/bin/mkdir -p /var/run/mongodb
ExecStartPre=/usr/bin/chown mongod:mongod /var/run/mongodb
ExecStartPre=/usr/bin/chmod 0755 /var/run/mongodb
PermissionsStartOnly=true
PIDFile=/var/run/mongodb/mongod.pid
Type=forking
# file size
LimitFSIZE=infinity
# cpu time
LimitCPU=infinity
# virtual memory size
LimitAS=infinity
# open files
LimitNOFILE=64000
# processes/threads
LimitNPROC=64000
# locked memory
LimitMEMLOCK=infinity
# total threads (user+kernel)
TasksMax=infinity
TasksAccounting=false
# Recommended limits for mongod as specified in
# https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings

[Install]
WantedBy=multi-user.target
~
a-aron087
  • 1
  • 1
  • Please don't paste screenshots, use formatted text. See https://meta.stackoverflow.com/q/285551/3027266 Did you check the Mongo logfile (typically `/var/log/mongodb/mongod.log`) – Wernfried Domscheit Dec 21 '21 at 07:02
  • If I execute "ls -l /var/log/mongodb/mongod.log" it returns, "-rwxrwxr-x. 1 mongod mongod 0 Dec 2 12:00 /var/log/mongodb/mongod.log". Also updated my original question to get rid of the screenshot. – a-aron087 Dec 22 '21 at 19:52
  • I mean, did you read the logfile? – Wernfried Domscheit Dec 22 '21 at 20:20
  • I have no clue what any of this stuff means. Do I need to execute vi /var/log/mongodb/mongod.log? Doing so yields a blank file. I've read through journalctl -xe and seems like it might be a vm resource issue but I have no idea. I kid you not I just starting using linux about 5 days ago. – a-aron087 Dec 22 '21 at 20:28
  • Ran "tail -f /var/log/mongodb/mongod.log" and it didn't seem to do anything so I ^C out and tried "tail -n5 -f /var/log/mongodb/mongod.log". Same result. – a-aron087 Dec 22 '21 at 20:50
  • Did you define a different log file? It is defined in your mongod.conf (see in `/usr/lib/systemd/system/mongod.service`) file. The log file should contain at least a few lines of initializatin commands. – Wernfried Domscheit Dec 22 '21 at 21:53
  • mongod.conf is pointing to /var/log/mongodb/mongod.log. Not sure why nothing is in the log file. I've seen mention of the forking section but can't remember what it should be set to. – a-aron087 Dec 22 '21 at 23:45
  • Remove the "fork" and try manual start like `sudo -u mongod mongod -f /etc/mongod.conf` Then you should get the logs on stdout – Wernfried Domscheit Dec 23 '21 at 06:19
  • Can you also post content of /usr/lib/systemd/system/mongod.service – Wernfried Domscheit Dec 23 '21 at 07:20
  • Added mongod.service. Trying to start it manually yields "illegal instruction". I've tried it a few different ways and they all return the same. – a-aron087 Dec 23 '21 at 14:29
  • Looks all normal. Verify all the files/folder permissions. Try `mongod --dbpath /var/lib/mongo` (as mongod user) – Wernfried Domscheit Dec 23 '21 at 15:03
  • Returns "Illegal instruction (core dumped)". I think I'm to the point where I need to just try something different. Everything I'm finding shows that all of my files are correct. Can't seem to verify permission but it seems odd that the installation wouldn't take care of that. Also seems like mongod.service is setting those permissions. – a-aron087 Dec 23 '21 at 15:42
  • In deed, I don't have any further proposals either. – Wernfried Domscheit Dec 23 '21 at 19:05
  • I appreciate your help though. Thanks! – a-aron087 Dec 23 '21 at 23:02

0 Answers0