当前位置:网站首页>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

边栏推荐
- JUnit unit test
- 《软件工程》期末重点复习笔记
- [机缘参悟-31]:鬼谷子-抵巇[xī]篇-危机是危险与机会并存
- Community ownership of NFT trading market is unstoppable
- Teach you to learn dapr - 4 Service invocation
- Teach you to learn dapr - 1 The era of net developers
- 【从删库到跑路】JDBC 完结篇(一天学完系列!!学完赶紧跑!)
- When a programmer is disturbed 10 times a day, the consequences are amazing!
- TCP congestion control details | 1 summary
- Développer un opérateur basé sur kubebuilder (démarrer)
猜你喜欢

探讨:下一代稳定币

对NFT市场前景的7个看法

建立自己的网站(16)

Community ownership of NFT trading market is unstoppable

Leetcode 1169. Query invalid transactions (if the amount of data is small, this problem still needs to be solved by violent enumeration)

Set up your own website (16)

防火 疏散 自救…这场安全生产暨消防培训干货满满!

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

Teach you to learn dapr - 2 Must know concept
![[Error] ld returned 1 exit status](/img/38/ec4645880d4c14e3766fbcabe8ddde.jpg)
[Error] ld returned 1 exit status
随机推荐
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
Teach you to learn dapr - 1 The era of net developers
STM32F103C8T6实现呼吸灯代码
Programmer interview guide - self introduction
day10每日3题(2):统计最大组的数目
Vibrating liquid quantity detecting device
[从零开始学习FPGA编程-46]:视野篇 - 集成电路的发展与技术进步
Discover K8E: minimalist kubernetes distribution
Codeforces Round #802 (Div. 2)
[Error] ld returned 1 exit status
Count the number of words in a line of string and take it as the return value of the function
JS tutorial electron JS is a good tool for designing powerful multi platform desktop applications
Calculate the average of N numbers in the group indexed by the formal parameter x, move the data less than the average in the group indexed to the front of the array, and move the data greater than or
对NFT市场前景的7个看法
TCP congestion control details | 1 summary
Web3 decentralized storage ecological landscape
Make up the weakness - Open Source im project openim about initialization / login / friend interface document introduction
Several forms of buffer in circuit
知道这几个命令让你掌握Shell自带工具
Niuke Xiaobai monthly race 50