Mongodb restarts after the linux system is rebooted

1.
/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongodb.conf 

clipboard.png


clipboard.png


clipboard.png

ask the great gods, how can you let mongodb start itself? What is the cause of this problem? How to avoid and modify it?

Mar.21,2021

has always advised people to use RPM or install from software sources, which is also one of the reasons. For the software source installation of
RHEL, please refer to the document . From installation to start, stop, boot self-start all talk.
it is important to note that you originally started with a root account, which is generally not recommended for security reasons. The version of the source installation is started by the mongod user, so you need to modify the corresponding directory permissions, including dbpath and some other places. When starting, pay attention to what permissions will prompt you in log,.

Menu