当前位置:网站首页>The most complete deployment of mongodb in history
The most complete deployment of mongodb in history
2022-07-07 04:05:00 【janyxe】
MongoDB List of articles
- In the history of the most complete MongoDB First knowledge of
- In the history of the most complete MongoDB Deployment of
If this article is helpful to your development path , Please give me a compliment , Your support is my motivation to stick to blogging
Preface
This series of courses will take you in the form of face-to-face test questions Go deep into distributed topics MongoDB. This article takes you through the deployment MongoDB
Linux install MongoDB
download MongoDB Community Server
1、 visit https://www.mongodb.com/try/download/community
2、 Choose the version
Linux edition
Interface download
Version: 4.4.14
Platform: RedHat / CentOS 7.0
curl download
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.4.14.tgz
tar -zxvf mongodb-linux-x86_64-rhel70-4.4.14.tgz
Windows platform (Win7\10\11) choice
start-up MongoDB
Create database path as well as Log path
[[email protected] local]# mv mongodb-linux-x86_64-rhel70-4.4.14 mongodb
[[email protected] local]# cd mongodb/
[[email protected] mongodb]# ls
bin LICENSE-Community.txt MPL-2 README THIRD-PARTY-NOTICES
[[email protected] mongodb]# mkdir -p data log
start-up MongoDB service
bin/mongod --port=27017 --dbpath=/usr/local/mongodb/data --logpath=/usr/local/mongodb/log/mongodb.log \
--bind_ip=0.0.0.0 --fork
Parameter description
Parameters | explain |
---|---|
–port | Designated port , The default is 27017 |
–bind_ip | binding ip, By default, only the local network card is monitored |
–dbpath | Specify the directory where the data file is stored |
–logpath | Log by appending |
–logappend | Log by appending |
–fork | Background start |
–auth | Turn on authentication mode |
curl MongoDB
The following information will be returned if the deployment is successful
curl 127.0.0.1:27017
Return the following information to explain MongoDB Successful launch
[[email protected] mongodb]# curl 127.0.0.1:27017
It looks like you are trying to access MongoDB over HTTP on the native driver port.
Configure environment variables
[[email protected] mongodb]# vi /etc/profile
Press Shift
+ G
To the bottom
Add the following environment variables
export MONGODB_HOME=/usr/local/mongodb
PATH=$PATH:$MONGODB_HOME/bin
Let the environment variables take effect
source /etc/profile
Start the service in profile mode
[[email protected] mongodb]# pwd
/usr/local/mongodb
[[email protected] mongodb]# mkdir config
[[email protected] mongodb]# vi config/mongod.conf
systemLog:
destination: file
path: "/usr/local/mongodb/log/mongodb.log" # Log path
logAppend: true # Enable append log
storage:
dbPath: "/usr/local/mongodb/data" # mongod Directory where data is stored
journal:
enabled: true # Enable or disable journal journal ( Persistence log )
processManagement:
fork: true # Whether to start in the background
net:
bindIp: 0.0.0.0 # Service instance binding ip, The default is localhost
port: 27017 # Binding port , The default is 27017
start-up mongoDB service
mongod -f config/mongod.conf
close MongoDB service
Normally shut down
[[email protected] mongodb]# mongod -f config/mongod.conf --shutdown
shell The way close
Get into mongoDB shell
mongo
Switch admin library , close mongodb
use admin
db.shutdownServer()
边栏推荐
- Ggplot facet detail adjustment summary
- Create commonly used shortcut icons at the top of the ad interface (menu bar)
- pyqt5 失焦 监听无操作 定时器
- Hongmi K40S root gameplay notes
- 杭州电 3711 Binary Number
- 史上最全学习率调整策略lr_scheduler
- Binary, octal, hexadecimal
- Enter the rough outline of the URL question (continuously updated)
- GPT-3当一作自己研究自己,已投稿,在线蹲一个同行评议
- The true face of function pointer in single chip microcomputer and the operation of callback function
猜你喜欢
PHP lightweight Movie Video Search Player source code
2022年电工杯B 题 5G 网络环境下应急物资配送问题思路分析
10 ways of interface data security assurance
数据的存储
Tflite model transformation and quantification
Summer 2022 daily question 1 (1)
NoSQL之Redis配置与优化
On file uploading of network security
Optimization cases of complex factor calculation: deep imbalance, buying and selling pressure index, volatility calculation
Kotlin Android environment construction
随机推荐
Kbone与小程序跨端开发的一些思考
力扣------路径总和 III
Enter the rough outline of the URL question (continuously updated)
使用 Dumpling 备份 TiDB 集群数据到 GCS
List interview common questions
ABAP 動態內錶分組循環
HW-小记(二)
It's too convenient. You can complete the code release and approval by nailing it!
Storage of data
2022年上半年HIT行业TOP50
什么是 CGI,什么是 IIS,什么是VPS「建议收藏」
ABAP Dynamic Inner table Group cycle
Implementation of binary search tree
Calculation of time and space complexity (notes of runners)
One of oscp tools: dirsearch usage Encyclopedia
使用 TiDB Lightning 恢复 GCS 上的备份数据
【安全攻防】序列化與反序列,你了解多少?
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
vim —- 自己主动的按钮indent该命令「建议收藏」
史上最全MongoDB之安全认证