当前位置:网站首页>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()
边栏推荐
- Food Chem|深度学习根据成分声明准确预测食品类别和营养成分
- 【mysql】mysql中行排序
- Using thread class and runnable interface to realize the difference between multithreading
- QT item table new column name setting requirement exercise (find the number and maximum value of the array disappear)
- Use dumping to back up tidb cluster data to GCS
- 维护万星开源向量数据库是什么体验
- Allow public connections to local Ruby on Rails Development Server
- Summer 2022 daily question 1 (1)
- Some thoughts on cross end development of kbone and applet
- 二叉搜索树的实现
猜你喜欢
On file uploading of network security
Ggplot facet detail adjustment summary
ABAP 動態內錶分組循環
Create commonly used shortcut icons at the top of the ad interface (menu bar)
cuda编程
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
NoSQL之Redis配置与优化
QT item table new column name setting requirement exercise (find the number and maximum value of the array disappear)
How to detect whether the MySQL code runs deadlock +binlog view
opencv第三方库
随机推荐
Top 50 hit industry in the first half of 2022
杭州电 3711 Binary Number
Storage of data
【写给初发论文的人】撰写综述性科技论文常见问题
golang 根据生日计算星座和属相
【编码字体系列】OpenDyslexic字体
[security attack and Defense] how much do you know about serialization and deserialization?
The true face of function pointer in single chip microcomputer and the operation of callback function
Do you choose pandas or SQL for the top 1 of data analysis in your mind?
Introduction to opensea platform developed by NFT trading platform (I)
2022夏每日一题(一)
【系统管理】清理任务栏的已删除程序的图标缓存
Preprocessing - interpolation
Redis source code learning (31), dictionary learning, dict.c (1)
自适应非欧表征广告检索系统AMCAD
golang 压缩和解压zip文件
【OA】Excel 文档生成器: Openpyxl 模块
Quick completion guide of manipulator (10): accessible workspace
【刷题记录】2. 两数相加
Class常量池与运行时常量池