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!