Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the failure to start the service after CentOS installs MongoDB

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, according to the download wizard of the MongoDB official website to install MongoDB, the service of starting MongoDB was found to be unable to start.

After a whole night of hard work, I finally got it. I hope I can help comrades who have the same difficulties.

First of all, Google and du Niang have searched countless articles and made numerous attempts, all of which have failed.

Try 1: some people say it's because of SElinux, but they still can't start it after shutting down SElinux.

Try 2: modify var/lib/mongo permissions, increase write permissions, invalid.

Try 3: create a new Data directory, and then use mongod-- dbpath to configure the Data directory, which still doesn't work.

Try 4: modify / etc/init.d/mongod file permissions, still invalid.

Finally, I read the mongo.conf documentation in the / etc directory and learned something. And found an article on Baidu:

Http://www.cnblogs.com/YOUCAN/archive/2013/01/27/2879121.html

The article says:

Delete the file:

Rm / data/mongodb/mongo.lock-- linux

Del / data/mongodb/mongo.lock-- windows

Then execute:

. / mongod-- repair

So I found the mongod.lock file under / var/lib and deleted it.

Finally, in the execution of mongod-repair

And then start the mongod service successfully!

Hope to help comrades who install according to the official website and then can't start the service.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report