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

What is the specific method for Linux system to start mongodb?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Today, let me introduce you to the specific method of Linux system startup mongodb. The content of the article Xiaobian think good, now to share with you, think there is a need for friends can understand, hope to help everyone, the following with the idea of Xiaobian to read together.

How to start mongodb in Linux?

Create a data directory:

# mkdir /data/mongo Create a profile

# vi /data/mongo/mongodb.cnf dbpath=/data/mongo/ logpath=/data/mongo/mongo.log logappend=true fork=true port=27017 Or: Start without creating a profile via the mongod parameter.

1. Start mongo by configuration file

# bin/mongod -f /data/mongo/mongodb.cnf or

# bin/mongod -f /data/mongo/mongodb.cnf &(put in the background to execute) 2. Parameters to start mongo

bin/mongod -dbpath /data/mongo/ -logpath/data/mongo/mongo. log-logappend -fork -port 27017 Terminal input:

The requested URL/data/mongo/mongo.log was not found on this server.

# bin/mongo Terminal input:

MongoDB shell version: 2.2.3 connecting to: test > Mongo is now working properly.

If you want mongo to start automatically with linux, add the following to/etc/rc.local:

The requested URL/data/mongo/was not found on this server. The requested URL/data/mongo/mongodb.cnf was not found on this server.

/.../ bin/mongod -dbpath /data/mongo/ -logpath/data/mongo/mongo.log-logappend -fork -port 27017 Additional Reminder:

1, Background start node command: nohup node /…/app.js &

Stop node and mongo both use kill.

If there is a startup ERROR: child process failed, exited with error number 100, usually because the last mongodb did not close properly, just need rm /…/mongod.lock.

The above is the Linux system to start the specific method of mongodb is what the whole content, more and Linux system to start the specific method of mongodb is what related content can be searched before the article or browse the following article to learn Ha! I believe that Xiaobian will add more knowledge to everyone, I hope you can support it!

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

Development

Wechat

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

12
Report