Hi ,
Troubleshooting further i end up with below
[root@ bin]# systemctl enable mongod
mongod.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mongod on
[root@ bin]# service mongod status
● mongod.service - SYSV: Mongo is a scalable, document-oriented database.
Loaded: loaded (/etc/rc.d/init.d/mongod; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2020-01-21 18:53:45 UTC; 2min 31s ago
Docs: man:systemd-sysv-generator(8)
Jan 21 18:53:45 .ec2.internal systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database…
Jan 21 18:53:45 .ec2.internal mongod[4099]: Error starting mongod. /var/run/mongodb/mongod.pid exists.
Jan 21 18:53:45 .ec2.internal systemd[1]: mongod.service: control process exited, code=exited status=1
Jan 21 18:53:45 .ec2.internal systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database…
Jan 21 18:53:45 .ec2.internal systemd[1]: Unit mongod.service entered failed state.
Jan 21 18:53:45 .ec2.internal systemd[1]: mongod.service failed.
[root@ bin]# service mongodb status
Redirecting to /bin/systemctl status mongodb.service
Unit mongodb.service could not be found.
[root@ bin]# service mongodb start
Redirecting to /bin/systemctl start mongodb.service
Failed to start mongodb.service: Unit not found.
[root@ bin]# systemctl enable mongod
mongod.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig mongod on
[root@ bin]# service mongod restart
Restarting 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]
[root@ bin]# service mongod status
● mongod.service - SYSV: Mongo is a scalable, document-oriented database.
Loaded: loaded (/etc/rc.d/init.d/mongod; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2020-01-21 18:53:45 UTC; 21s ago
Docs: man:systemd-sysv-generator(8)
Process: 4099 ExecStart=/etc/rc.d/init.d/mongod start (code=exited, status=1/FAILURE)
Jan 21 18:53:45 .ec2.internal systemd[1]: Starting SYSV: Mongo is a scalable, document-oriented database…
Jan 21 18:53:45 .ec2.internal mongod[4099]: Error starting mongod. /var/run/mongodb/mongod.pid exists.
Jan 21 18:53:45 .ec2.internal systemd[1]: mongod.service: control process exited, code=exited status=1
Jan 21 18:53:45 .ec2.internal systemd[1]: Failed to start SYSV: Mongo is a scalable, document-oriented database…
Jan 21 18:53:45 .ec2.internal systemd[1]: Unit mongod.service entered failed sta
I start using db service using mongod
[root@ bin]# ./mongod --fork --logpath /var/log/mongodb.log
about to fork child process, waiting until server is ready for connections.
forked process: 3722
child process started successfully, parent exiting
[root@ bin]# tail -f /var/log/mongodb.log
2020-01-21T18:42:35.791+0000 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2020-01-21T18:42:35.791+0000 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2020-01-21T18:42:35.791+0000 I CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2020-01-21T18:42:35.791+0000 I CONTROL [initandlisten]
2020-01-21T18:42:35.800+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory ‘/data/db/diagnostic.data’
2020-01-21T18:42:35.814+0000 I INDEX [initandlisten] build index on: admin.system.version properties: { v: 2, key: { version: 1 }, name: “incompatible_with_version_32”, ns: “admin.system.version” }
2020-01-21T18:42:35.814+0000 I INDEX [initandlisten] building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2020-01-21T18:42:35.815+0000 I INDEX [initandlisten] build index done. scanned 0 total records. 0 secs
2020-01-21T18:42:35.816+0000 I COMMAND [initandlisten] setting featureCompatibilityVersion to 3.4
2020-01-21T18:42:35.817+0000 I NETWORK [thread1] waiting for connections on port 27017
^C
[root@ bin]# ps -ef |grep mongod
root 3722 1 0 18:42 ? 00:00:00 ./mongod --fork --logpath /var/log/mongodb.log
root 3744 3545 0 18:42 pts/0 00:00:00 grep --color=auto mongod
[root@ bin]# service mongodb status
Redirecting to /bin/systemctl status mongodb.service
Unit mongodb.service could not be found.
[root@ bin]# systemctl enable mongod
mongod.service is not a native service, redirecting to /sbin/chkconfig.