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 are the specific steps for Linux to install MongoDB

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

Share

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

This article will explain in detail what are the specific steps for Linux to install MongoDB. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

MongoDB is a database based on distributed file storage. Written in C++ language. Designed to provide scalable high-performance data storage solutions for WEB applications.

Specific method of installing MongoDB in Linux

I. installation process

1. Download the compression package of the corresponding system on the official website of mongodb. My system is Ubuntu16.04,64 bit. (be careful not to choose the wrong system version, or you can download it locally and upload it to the CVM)

2. The default download path is to go to the Downloads directory under the user's directory and extract it.

Tar-zxvf mongodb-linux-x86_64-3.2.12.tgz3. Move the extracted folder to the mongodb directory of / usr/local/

Mv-r mongodb-linux-x86_64-3.2.12 / usr/local/mongodb4. Configure the system file profile

Sudo vi / etc/profile inserts the following:

Export MONGODB_HOME=/usr/local/mongodb export PATH=$PATH:$MONGODB_HOME/bin Note: restart the system configuration after saving:

Source / etc/profile5. Create a folder to store data and log files, and modify its permissions to increase read and write permissions

Cd / usr/local/mongodb sudo mkdir-p data/dbsudo chmod-r 777 data/dbsudo mkdir logs cd logs touch mongodb.log

6.mongodb startup configuration

Go to the bin directory and add a configuration file:

Cd / usr/local/mongodb/bin sudo vi mongodb.conf inserts the following:

Dbpath = / usr/local/mongodb/data/db # data file storage directory logpath = / usr/local/mongodb/logs/mongodb.log # log file storage directory port = 27017 # port fork = true # enabled as a daemon, that is, running nohttpinterface = true7 in the background. Start the mongod database service and start it as a configuration file

Cd / usr/local/mongodb/bin. / mongod-f mongodb.conf8. Connect to mongodb database

. / mongo

On Linux installation MongoDB specific steps are shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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