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

How to install mongodb on Ali CVM

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Download mongodb

Curl-O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.9.tgz

two。 Decompression

Tar zxvf mongodb-linux-x86_64-3.2.9.tgz

3. Create data folders, log files, etc.

Mkdir-p / usr/local/mongodb/datatouch / usr/local/mongodb/mongod.logtouch / usr/local/mongodb/mongodb.conf

4. Start

Go to the bin directory of mongo to execute

(1) Parameter startup

. / mongod-dbpath=/usr/local/mongodb/data-logpath=/usr/local/mongodb/mongod.log-logappend-port=27017-fork

(2) configuration file startup

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

The configuration file is as follows

Dbpath=/usr/local/mongodb/datalogpath=/usr/local/mongodb/mongod.loglogappend = true port = 27017 fork = true auth = true

5. Create a user (after the creation is completed, you need to configure a firewall in the Ali Cloud console to connect)

Db.createUser ({'user': "username", "pwd": "password", roles: [{' role': "role permission (dbAdmin)", db: "admin"}]})

Summary

The above is the method of installing mongodb on Ali cloud server introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

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