Mongod.service start command is not working after db path move

Below steps I followed to move the mongo db path from one location to other

1.Stop MongoDB services
sudo systemctl stop mongod.service

2.create a new directory in separate partition
mkdir /data/mongoDB/mongo

3.Make sure that mongod user has privileges to read / write from that directory
chown mongod:mongod -R /data/mongoDB

4.Copy the data folder of your old mongodb location to the new location
cp -R /var/lib/mongo/* /data/mongoDB/mongo/

5.create a copy of /etc/mongod.conf – for backup purpose

  1. change to new location of below variables in /etc/mongod.conf

path:
dbPath:
pidFilePath:

  1. change the pid file location in mongod.service file
    /usr/lib/systemd/system/mongod.service

  2. Run below command to reflect changes done
    systemctl daemon-reload

8.Start mongodb services
sudo systemctl start mongod.service
Job for mongod.service failed because the control process exited with error code. See “systemctl status mongod.service” and “journalctl -xe” for details

NOTE-

  1. i checked the log file and there was no error registered after mongod shutdown
  2. i checked journalctl log file and below line appears
    ERROR: child process failed, exited with error number 1**
    To see additional information in this output, start without the “–fork” option.**

i used below command and mongodb started functioning
mongod --confog=/etc/mongod.conf

CAN YOU HELP HERE…AM I MISSING ANYTHING AND HOW CAN WE FIX mongod.service status???

@Fabio_Ramohitaj any idea, how to fix
suprisingly in some servers it is working, and some doesnot

we tried below options as well, still not working

Option 1:

server reboot

Option2:

  • remove mongod.lock file

*repair mongo db with below command

mongod --dbpath /data/mongoDB/mongo –repair

Hi @Chinmaya_Das,
Unfortunately I’m out right now and I have no way to do a test, but I can advise you to check if all the paths in the configuration file are correct.
The problem is that the exit status 1 is a too generic error and it happened to me when I had a wrong path in the configuration file or a wrong option or a wrong indentation .

Best regards and keep me updated.

surprisingly in few servers it is working, and in few servers it is not

I tried to replicate and cross check the permission, indentation, path ownership everything
still issue persists

1 Like

Hi @Chinmaya_Das ,
I haven’ t any idea,
we can try to ask @Stennie or @chris for help .

Regards

@Stennie @chris --can you assist

Hi @Chinmaya_Das ,

I’d strongly discourage option #2 per the warnings in `mongod --repair’ documentation:

  • Only use mongod --repair if you have no other options. The operation removes and does not save any corrupt data during the repair process.
  • Avoid running --repair against a replica set member:
    • To repair a replica set member, if you have an intact copy of your data available (e.g. a recent backup or an intact member of the replica set), restore from that intact copy instead(see Resync a Member of a Replica Set).
    • If you do choose to run mongod --repair against a replica set member and the operation modifies the data or the metadata, you must still perform a full resync in order for the member to rejoin the replica set.

If mongod fails to start as a service but runs via manual invocation with the same config file, my guess would be that there is a problem with file or directory permissions that you are avoiding by running mongod as the root user. I would check permissions for any paths mentioned in your /etc/mongod.conf (step 6).

If permissions aren’t the issue, I’d try this suggestion.

If you’re still stuck, please share more details including:

  • specific version of MongoDB server
  • type of deployment (standalone, replica set, or sharded cluster)
  • O/S version

Regards,
Stennie

-bash-4.2$ cat /etc/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: /data/mongoDB/log/mongod.log

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

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

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


#security:
security:
  authorization: enabled
#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options

#auditLog:

#snmp:

-bash-4.2$ cd /data
-bash-4.2$ ll
total 20
drwx------. 2 mongod mongod 16384 Nov 11 23:27 lost+found
drwx------. 4 mongod mongod  4096 Jan 11 11:49 mongoDB
-bash-4.2$ cd mongoDB
-bash-4.2$ ll
total 28
drwx------. 2 mongod mongod  4096 Jan 11 11:49 log
drwx------. 4 mongod mongod 16384 Jan 11 11:56 mongo
-rw-r--r--. 1 mongod mongod   862 Jun 29  2021 mongod.conf.bkpjab11
-rw-r--r--. 1 mongod mongod     6 Jan 11 11:49 mongod.pid
-bash-4.2$ mongod --version
db version v4.2.6
git version: 20364840b8f1af16917e4c23c1b5f5efd8b352f8
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
    distmod: rhel70
    distarch: x86_64
    target_arch: x86_64
=====================================
-bash-4.2$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
1 Like

i am running below commands using mongod user ( not via root)

mongod -f /etc/mongod.conf
systemctl start mongod.serice

Need output of

ls -l /data/mongoDB/log/
ls -l /data/mongoDB/mongo/

If mongod was started by root, it is possible that the log file is now own by root and cannot be overwritten by user mongod.

2 Likes

@stevej

-bash-4.2$ ls -l /data/mongoDB/log/
total 284
-rw-------. 1 mongod mongod 283709 Jan 12 23:35 mongod.log
-bash-4.2$ ls -l /data/mongoDB/mongo/
total 8379412
-rw-------. 1 mongod mongod     196608 Jan 12 09:02 collection-0--1245733199008363699.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-0--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:43 collection-0-2938523890601203458.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:43 collection-0-4663825045788152862.wt
-rw-------. 1 mongod mongod     131072 Jan 12 04:49 collection-0--5305699207077892184.wt
-rw-------. 1 mongod mongod      45056 Jan 12 04:49 collection-0-6066076875358285443.wt
-rw-------. 1 mongod mongod      45056 Jan 11 11:49 collection-0-9092172278719928609.wt
-rw-------. 1 mongod mongod      36864 Jan 12 21:35 collection-0--9202003834816367794.wt
-rw-------. 1 mongod mongod    2969600 Jan 12 06:31 collection-10--1809642965555131340.wt
-rw-------. 1 mongod mongod     561152 Jan 12 09:02 collection-10--5305699207077892184.wt
-rw-------. 1 mongod mongod    1388544 Jan 12 09:03 collection-11-3147801643784858223.wt
-rw-------. 1 mongod mongod  253083648 Jan 12 08:55 collection-12--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 collection-13-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-13--5305699207077892184.wt
-rw-------. 1 mongod mongod     118784 Jan 12 16:32 collection-15-3147801643784858223.wt
-rw-------. 1 mongod mongod   42283008 Jan 12 09:02 collection-16--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:40 collection-17-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-18--1809642965555131340.wt
-rw-------. 1 mongod mongod      61440 Jan 12 15:14 collection-18--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:41 collection-19-3147801643784858223.wt
-rw-------. 1 mongod mongod   21434368 Jan 12 09:02 collection-20--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 15:14 collection-2--1245733199008363699.wt
-rw-------. 1 mongod mongod      45056 Jan 12 05:41 collection-21-3147801643784858223.wt
-rw-------. 1 mongod mongod    4706304 Jan 12 09:02 collection-22--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-22--5305699207077892184.wt
-rw-------. 1 mongod mongod       4096 Jan 12 05:34 collection-2-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 collection-23-3147801643784858223.wt
-rw-------. 1 mongod mongod      53248 Jan 12 15:14 collection-23--5305699207077892184.wt
-rw-------. 1 mongod mongod   32006144 Jan 12 09:02 collection-24--1809642965555131340.wt
-rw-------. 1 mongod mongod      45056 Jan 12 15:14 collection-2--4569173258061928719.wt
-rw-------. 1 mongod mongod      20480 Jan 11 11:43 collection-2-4663825045788152862.wt
-rw-------. 1 mongod mongod   71290880 Jan 12 08:24 collection-2--5305699207077892184.wt
-rw-------. 1 mongod mongod      45056 Jan 12 05:41 collection-25-3147801643784858223.wt
-rw-------. 1 mongod mongod      77824 Jan 12 00:48 collection-2-6066076875358285443.wt
-rw-------. 1 mongod mongod  115519488 Jan 12 09:02 collection-26--1809642965555131340.wt
-rw-------. 1 mongod mongod      40960 Jan 12 05:34 collection-27-3147801643784858223.wt
-rw-------. 1 mongod mongod   11030528 Jan 12 06:31 collection-28--1809642965555131340.wt
-rw-------. 1 mongod mongod      40960 Jan 12 21:35 collection-2--9202003834816367794.wt
-rw-------. 1 mongod mongod      53248 Jan 12 05:34 collection-29-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-29--5305699207077892184.wt
-rw-------. 1 mongod mongod      69632 Jan 12 09:02 collection-30--1809642965555131340.wt
-rw-------. 1 mongod mongod      49152 Jan 12 05:34 collection-31-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-31--5305699207077892184.wt
-rw-------. 1 mongod mongod     376832 Jan 12 05:34 collection-33-3147801643784858223.wt
-rw-------. 1 mongod mongod     249856 Jan 12 09:02 collection-34--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-34--5305699207077892184.wt
-rw-------. 1 mongod mongod      45056 Jan 12 09:02 collection-35-3147801643784858223.wt
-rw-------. 1 mongod mongod  797519872 Jan 12 09:02 collection-36--1809642965555131340.wt
-rw-------. 1 mongod mongod   19816448 Jan 12 09:02 collection-39-3147801643784858223.wt
-rw-------. 1 mongod mongod 2715410432 Jan 12 09:02 collection-40--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 08:32 collection-41-3147801643784858223.wt
-rw-------. 1 mongod mongod 3723812864 Jan 12 06:31 collection-4--1809642965555131340.wt
-rw-------. 1 mongod mongod     131072 Jan 12 05:34 collection-4-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 08:32 collection-43-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 08:32 collection-45-3147801643784858223.wt
-rw-------. 1 mongod mongod  218435584 Jan 12 09:02 collection-46--1809642965555131340.wt
-rw-------. 1 mongod mongod     249856 Jan 12 09:02 collection-47-3147801643784858223.wt
-rw-------. 1 mongod mongod      24576 Jan 12 22:39 collection-4--9202003834816367794.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 collection-49-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-49--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-50--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 collection-51-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-51--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-52--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-52--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 collection-53-3147801643784858223.wt
-rw-------. 1 mongod mongod     462848 Jan 12 09:02 collection-5--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 collection-55-3147801643784858223.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 collection-57-3147801643784858223.wt
-rw-------. 1 mongod mongod       4096 Jan 12 09:02 collection-57--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-58--5305699207077892184.wt
-rw-------. 1 mongod mongod      61440 Jan 12 09:02 collection-59--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 collection-6--1809642965555131340.wt
-rw-------. 1 mongod mongod      73728 Jan 11 11:44 collection-6-2938523890601203458.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-65--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 collection-66--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-67--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 collection-73--5305699207077892184.wt
-rw-------. 1 mongod mongod       4096 Jan 12 09:02 collection-75--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 collection-76--5305699207077892184.wt
-rw-------. 1 mongod mongod   18849792 Jan 12 09:02 collection-8--1809642965555131340.wt
-rw-------. 1 mongod mongod  233172992 Jan 11 11:44 collection-8-2938523890601203458.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 collection-83--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-84--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 collection-89--5305699207077892184.wt
-rw-------. 1 mongod mongod      61440 Jan 12 05:34 collection-9-3147801643784858223.wt
-rw-------. 1 mongod mongod    3988819 Jan 11 11:44 cpu_stats.txt
drwx------. 2 mongod mongod       4096 Jan 12 23:46 diagnostic.data
-rw-------. 1 mongod mongod   26472448 Jan 11 11:44 index-10-2938523890601203458.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-10-3147801643784858223.wt
-rw-------. 1 mongod mongod      81920 Jan 12 09:02 index-11--1809642965555131340.wt
-rw-------. 1 mongod mongod      40960 Jan 12 09:02 index-1--1245733199008363699.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-1--1809642965555131340.wt
-rw-------. 1 mongod mongod   26210304 Jan 11 11:44 index-12-2938523890601203458.wt
-rw-------. 1 mongod mongod      45056 Jan 12 09:03 index-12-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:44 index-1-2938523890601203458.wt
-rw-------. 1 mongod mongod    2162688 Jan 12 08:55 index-13--1809642965555131340.wt
-rw-------. 1 mongod mongod    1466368 Jan 12 08:55 index-14--1809642965555131340.wt
-rw-------. 1 mongod mongod   52875264 Jan 11 11:44 index-14-2938523890601203458.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-14-3147801643784858223.wt
-rw-------. 1 mongod mongod     126976 Jan 12 09:02 index-14--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:44 index-1-4663825045788152862.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-1--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-1-6066076875358285443.wt
-rw-------. 1 mongod mongod      61440 Jan 12 16:32 index-16-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 04:49 index-16--5305699207077892184.wt
-rw-------. 1 mongod mongod    1044480 Jan 12 09:02 index-17--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-17--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:40 index-18-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:44 index-1-9092172278719928609.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-19--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:49 index-1--9202003834816367794.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:40 index-20-3147801643784858223.wt
-rw-------. 1 mongod mongod     364544 Jan 12 09:02 index-21--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 15:14 index-21--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:41 index-22-3147801643784858223.wt
-rw-------. 1 mongod mongod      69632 Jan 12 09:02 index-23--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-24-3147801643784858223.wt
-rw-------. 1 mongod mongod     294912 Jan 12 09:02 index-25--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:41 index-26-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-26--5305699207077892184.wt
-rw-------. 1 mongod mongod     618496 Jan 12 09:02 index-27--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 15:14 index-27--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-28-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:49 index-2-9092172278719928609.wt
-rw-------. 1 mongod mongod     360448 Jan 12 09:02 index-29--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-30-3147801643784858223.wt
-rw-------. 1 mongod mongod      45056 Jan 12 09:02 index-31--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 15:14 index-3--1245733199008363699.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-32--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-32-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-32--5305699207077892184.wt
-rw-------. 1 mongod mongod       4096 Jan 12 05:34 index-3-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-34-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 15:14 index-3--4569173258061928719.wt
-rw-------. 1 mongod mongod      20480 Jan 11 11:44 index-3-4663825045788152862.wt
-rw-------. 1 mongod mongod     102400 Jan 12 09:02 index-35--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-3-6066076875358285443.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-36-3147801643784858223.wt
-rw-------. 1 mongod mongod   17780736 Jan 12 09:02 index-37--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-37--5305699207077892184.wt
-rw-------. 1 mongod mongod   11055104 Jan 12 09:02 index-38--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-38--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 21:35 index-3--9202003834816367794.wt
-rw-------. 1 mongod mongod     581632 Jan 12 09:02 index-40-3147801643784858223.wt
-rw-------. 1 mongod mongod   37298176 Jan 12 09:02 index-41--1809642965555131340.wt
-rw-------. 1 mongod mongod   15314944 Jan 12 09:02 index-42--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 08:32 index-42-3147801643784858223.wt
-rw-------. 1 mongod mongod   15351808 Jan 12 09:02 index-44--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 08:32 index-44-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 08:32 index-46-3147801643784858223.wt
-rw-------. 1 mongod mongod    1646592 Jan 12 09:02 index-47--1809642965555131340.wt
-rw-------. 1 mongod mongod     761856 Jan 12 09:02 index-48--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-48-3147801643784858223.wt
-rw-------. 1 mongod mongod     761856 Jan 12 09:02 index-50--1809642965555131340.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 index-50-3147801643784858223.wt
-rw-------. 1 mongod mongod   14553088 Jan 12 09:02 index-5--1809642965555131340.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 index-52-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-5-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-53--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-53--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 index-54-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-54--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-55--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 08:32 index-56-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-56--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-58-3147801643784858223.wt
-rw-------. 1 mongod mongod      24576 Jan 12 22:39 index-5--9202003834816367794.wt
-rw-------. 1 mongod mongod       4096 Jan 12 09:02 index-61--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-62--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 05:34 index-6-3147801643784858223.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-63--5305699207077892184.wt
-rw-------. 1 mongod mongod     372736 Jan 12 08:24 index-6--5305699207077892184.wt
-rw-------. 1 mongod mongod      12288 Jan 12 22:41 index-6--9202003834816367794.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-69--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-70--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-71--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-7--1809642965555131340.wt
-rw-------. 1 mongod mongod      36864 Jan 11 11:44 index-7-2938523890601203458.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-77--5305699207077892184.wt
-rw-------. 1 mongod mongod       4096 Jan 12 09:02 index-79--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-80--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-87--5305699207077892184.wt
-rw-------. 1 mongod mongod      20480 Jan 12 09:02 index-88--5305699207077892184.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-90--5305699207077892184.wt
-rw-------. 1 mongod mongod     135168 Jan 12 09:02 index-9--1809642965555131340.wt
-rw-------. 1 mongod mongod   58232832 Jan 11 11:44 index-9-2938523890601203458.wt
-rw-------. 1 mongod mongod      36864 Jan 12 09:02 index-9--5305699207077892184.wt
drwx------. 2 mongod mongod       4096 Jan 11 11:49 journal
-rw-------. 1 mongod mongod      53248 Jan 11 11:49 _mdb_catalog.wt
-rw-------. 1 mongod mongod          6 Jan 11 11:49 mongod.lock
-rw-------. 1 mongod mongod      53248 Jan 12 22:40 sizeStorer.wt
-rw-------. 1 mongod mongod        114 Jan 11 11:44 storage.bson
-rw-------. 1 mongod mongod         46 Jan 11 11:44 WiredTiger
-rw-------. 1 mongod mongod       4096 Jan 11 11:49 WiredTigerLAS.wt
-rw-------. 1 mongod mongod         21 Jan 11 11:44 WiredTiger.lock
-rw-------. 1 mongod mongod       1269 Jan 12 22:42 WiredTiger.turtle
-rw-------. 1 mongod mongod     466944 Jan 12 22:42 WiredTiger.wt

You will need to share the content of the log file because everything looks fine.

More commands to run:

cat /data/mongoDB/mongod.pid
ps -aef | grep [m]ongod
ss -tlnp
ls -l /tmp/mongo*

You have to do one or the other. Not both. If you start mongod once manually, it won’t start as a service because it is already running.

1 Like

I’ll try not to add noise to the post, but normally running from CLI with the --fork option, and the same yaml configuration file (commenting # the fork) throws some good information to start troubleshooting.

Also, including the logs after starting the service, even though you believe it’s not relevant, it may be useful. Because error status 1 is thrown by systemd but does not correspond to a mongod error afaik

1 Like

Hi @Chinmaya_Das

Is SELinux enabled? If it is change the SELinux mode to permissive and try again.

If you need SELinux then moving the directories around while not difficult become non-trivial.

I think I have posted about it before or it may even be documented alrady.

2 Likes

SELINUX=permissive

1 Like