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

边栏推荐
猜你喜欢

数据的存储

Redis configuration and optimization of NoSQL

SQL injection -day15

Machine learning notes - bird species classification using machine learning

MySQL data loss, analyze binlog log file

List interview common questions

What is the experience of maintaining Wanxing open source vector database

Introduction to opensea platform developed by NFT trading platform (I)

Probability formula

机械臂速成小指南(十):可达工作空间
随机推荐
OSCP工具之一: dirsearch用法大全
Class常量池与运行时常量池
Tflite model transformation and quantification
PHP implements lottery according to probability
Redis configuration and optimization of NoSQL
使用Thread类和Runnable接口实现多线程的区别
web服务性能监控方案
预处理——插值
Mysql-数据丢失,分析binlog日志文件
Storage of data
你心目中的数据分析 Top 1 选 Pandas 还是选 SQL?
Hisilicon 3559 universal platform construction: RTSP real-time playback support
leetcode:面试题 17.24. 子矩阵最大累加和(待研究)
维护万星开源向量数据库是什么体验
Antd Comment 递归循环评论
2022中青杯数学建模B题开放三孩背景下的生育政策研究思路
一些常用软件相关
三重半圆环进度条,直接拿去就能用
再AD 的 界面顶部(菜单栏)创建常用的快捷图标
List interview common questions