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

Mongodb single installation

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

Share

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

1. Download mongdb

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

2. Environmental preparation:

1 mkdir / home/mongodb # create MongoDB program storage directory 2 mkdir / data/mongodata-p # create data storage directory 3 mkdir / data/log/mongolog-p # create log storage directory 3, install: 1 tar xf mongodb-linux-x86_64-3.2.1.tgz2 cd mongodb-linux-x86_64-3.2.13 cp-r * / home/mongodb to facilitate command startup You need to edit the global variable PATH1 vim / etc/profile.d/mongo.sh2 export PATH=$PATH:/home/mongodb/binsource / etc/profile.d/mongo.sh4 to start the service and first check the help information of mongod.

Example of starting a service:

1 mongod-- dbpath=/data/mongodata-- directoryperdb-- logpath=/data/log/mongolog/mongodb.log-- logappend-- fork

Check to see if it starts:

1 netstat-tnlp | grep mongod2 tcp 0 0 0.0.0 0 grep mongod2 tcp 27017 0.0.0 0 LISTEN 17909/mongod

As can be seen above, port 27017 is already running.

5. Test

Start the shell of mongodb:

1 [root@test ~] # mongo 2 MongoDB shell version: 3.2.1

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