-1

Having some trouble configuring mongodb to Linux ec2 after following these directions https://docs.mongodb.com/ecosystem/platforms/amazon-ec2/

[root@ip-xxx-xx-xx-xxx /]# sudo service mongod start
Error starting mongod. /var/run/mongodb/mongod.pid exists.


[root@ip-xxx-xx-xx-xxx /]# sudo service mongod restart
Stopping mongod:                                           [  OK  ]
Starting mongod:                                           [FAILED]

I also tried rm -f /var/run/mongodb/mongod.pid which now instantly fails.

[root@ip-xxx-xx-xx-xxx /]# sudo service mongod start
Starting mongod:                                           [FAILED]

I have a feeling it may be my mongod.conf and tried editing the dbPath and sysLogPath according to the docs.

# mongod.conf

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

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

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

I am new to both AWS and deploying a db, and would appreciate suggestions!

Chris
  • 609
  • 3
  • 9
  • 21

2 Answers2

4

After checking to log/mongod.log as @hjpotter92 suggested I found it was ***aborting after fassert() failure

From the link below I ran the commands, which was successful.

sudo rm /tmp/mongodb-27017.sock rm -f /var/run/mongodb/mongod.pid sudo service mongod start

MongoDB Failing to Start - ***aborting after fassert() failure

Community
  • 1
  • 1
Chris
  • 609
  • 3
  • 9
  • 21
0

you are using sudo while logged in as root . Please recheck if this is is causing the issue .

Gurdyal
  • 161
  • 2
  • 2
  • 11