当前位置:网站首页>Environment setup mongodb
Environment setup mongodb
2022-06-26 16:54:00 【wangmcn】
Catalog
This article focuses on CentOS Installation in environment MongoDB.
1、 brief introduction
MongoDB Is a database based on distributed file storage . from C++ Language writing . For the purpose of Web Applications provide scalable, high-performance data storage solutions .
MongoDB Is a product between relational and non-relational databases , Non-relational databases are the most versatile , Most like a relational database . The data structure it supports is very loose , Is similar to json Of bson Format , Therefore, more complex data types can be stored . The biggest feature is that it supports a very powerful query language , Its syntax is somewhat similar to that of an object-oriented query language , You can almost implement most of the functionality of a relational database single table query , It also supports indexing data .
Official website address :
https://www.mongodb.com/
2、 install
1、 Install dependency packages
sudo yum install libcurl openssl2、 download
Official website download address ( Community Edition ):
https://www.mongodb.com/try/download/community
Select the appropriate version 、 platform 、 package , Download or copy the download link to download .

for example : download mongodb-linux-x86_64-rhel70-5.0.5.tgz

And upload the downloaded file to the server

Or enter the command directly , Download on the server
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-5.0.5.tgz3、 decompression
tar -zxvf mongodb-linux-x86_64-rhel70-5.0.5.tgzDecompress and generate mongodb-linux-x86_64-rhel70-5.0.5 Catalog

4、 Move the unzipped package to the specified directory (/usr/local/), And named it mongodb5
mv mongodb-linux-x86_64-rhel70-5.0.5 /usr/local/mongodb55、 Set the environment variable
(1) Modify the configuration file
vim /etc/profile(2) Fill in the last line (mongodb The file path shall be subject to the actual )
export PATH=$PATH:/usr/local/mongodb5/bin(3) Make configuration effective
source /etc/profile3、 Start and stop
1、 Create a data storage directory (/var/lib/mongodb), And authorize
sudo mkdir -p /var/lib/mongodb
sudo chown 755 /var/lib/mongodb2、 Create a directory of log files (/var/log/mongodb), And authorize
sudo mkdir -p /var/log/mongodb
sudo chown 755 /var/log/mongodb3、 Start the service
mongod --dbpath /var/lib/mongodb --logpath/var/log/mongodb/mongod.log --fork
4、 Out of Service
Mode one :
mongod --dbpath /var/lib/mongodb --logpath/var/log/mongodb/mongod.log --shutdownMode two :
Input mongo, Get into mongo Under orders

Enter the following commands in sequence
use admin
db.shutdownServer()
exit

边栏推荐
- 1-12vmware adds SSH function
- Junit单元测试
- Kubecon China 2021 Alibaba cloud special session is coming! These first day highlights should not be missed
- 《软件工程》期末重点复习笔记
- 板卡的分级调试经验
- Redis migration (recommended operation process)
- 【从删库到跑路】JDBC 完结篇(一天学完系列!!学完赶紧跑!)
- Calculate the average of N numbers in the index group of X, and return the number that is less than the average and closest to the average through formal parameters
- Community ownership of NFT trading market is unstoppable
- [force deduction question] two point search: 4 Find the median of two positive arrays
猜你喜欢

Can Luo Yonghao succeed in entering the AR field this time?

Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)

Kubecon China 2021 Alibaba cloud special session is coming! These first day highlights should not be missed

Cloud platform monitoring system based on stm32+ Huawei cloud IOT design

进军AR领域,这一次罗永浩能成吗?

What is the difference between digital collections and NFT

Turtle cartography

Développer un opérateur basé sur kubebuilder (démarrer)

QT 5.9.8 installation tutorial

JUnit unit test
随机推荐
Vibrating liquid quantity detecting device
Leetcode 1169. 查询无效交易(如果数据量不大,这种题还是得暴力枚举解决)
Pybullet robot simulation environment construction 5 Robot pose visualization
Redis overview
Redis OM . Net redis object mapping framework
day10每日3题(1):逐步求和得到正数的最小值
Teach you to learn dapr - 9 Observability
Teach you to learn dapr - 1 The era of net developers
Codeforces Round #802 (Div. 2)
GUI+SQLServer考试系统
Teach you to learn dapr - 2 Must know concept
The first open source MySQL HTAP database in China will be released soon, and the three highlights will be notified in advance
Screenshot of the answers to C language exercises
20:第三章:开发通行证服务:3:在程序中,打通redis服务器;(仅仅是打通redis服务器,不涉及具体的业务开发)
JUnit unit test
构造函数和析构函数
Summary of all knowledge points of C language
Interpretation of cloud native microservice technology trend
5G未平6G再启,中国引领无线通信,6G的最大优势在哪里?
Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)