当前位置:网站首页>下载并安装MongoDB
下载并安装MongoDB
2022-04-23 15:57:00 【aserendipper】
一、下载MongoDB
1、打开MongoDB官网下载主页https://www.mongodb.com/try/download,找到community社区版,然后选择对应的版本下载。
Version版本,选择带有current字眼的,这是最新的稳定版本
OS是系统,这里选择RHEL 7.0 ,对应的Centos就是7.x
Package 是包的格式,这里选择TGZ,是压缩包

二、安装MongoDB
1、上传压缩包到/usr/local目录下并解压
tar -zxvf mongodb-linux-x86_64-rhel70-4.2.8.tgz
2、重命名文件夹为mongodb
mv mongodb-linux-x86_64-rhel70-4.2.8/ mongodb/
3、进入mongodb文件夹下,创建数据和日志存放的文件夹
mkdir data #用来存放mongodb的数据库数据
mkdir logs #用来存放mongodb运行产生的日志
4、创建配置文件
vim mongodb.conf
#日志文件位置
logpath=/usr/local/mongodb/logs/mongodb.log
#以追加方式写入日志
logappend=true
#是否以守护进程方式运行
fork=true
#端口27017
port=27017
#数据库文件位置
dbpath=/software/mongodb/data
#允许哪个ip的连接,0.0.0.0表示任一ip都可以连接
bind_ip=0.0.0.0
#是否以安全认证方式运行,默认是不认证的非安全方式,一开始安装启动不需要开启,设置好密码后再重启
#auth=true
此时的目录结构为:

5、启动mongodb
bin/mongod --config mongodb.conf
启动成功后:

6、连接mongodb并测试
进入bin目录下,执行
./mongo
show dbs
可以看到有默认的三个数据库

三、参考资料
1、https://blog.csdn.net/americaMan/article/details/105755863
版权声明
本文为[aserendipper]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_39234967/article/details/109444803
边栏推荐
- matplotlib教程05---操作图像
- Vision of building interstellar computing network
- 糖尿病眼底病变综述概要记录
- Treatment of idempotency
- ESP32_ Arduino
- One brush 314 sword finger offer 09 Implement queue (E) with two stacks
- Go language slice, range, set
- Pgpool II 4.3 Chinese Manual - introductory tutorial
- 负载均衡器
- Coalesce and repartition of spark operators
猜你喜欢
The principle and common methods of multithreading and the difference between thread and runnable
负载均衡器
volatile的含义以及用法
CVPR 2022 quality paper sharing
Day (9) of picking up matlab
捡起MATLAB的第(8)天
捡起MATLAB的第(5)天
腾讯Offer已拿,这99道算法高频面试题别漏了,80%都败在算法上
新动态:SmartMesh和MeshBox的合作新动向
Temporal model: long-term and short-term memory network (LSTM)
随机推荐
Grbl learning (I)
MySQL optimistic lock to solve concurrency conflict
Day (8) of picking up matlab
PS add texture to picture
5 minutes, turn your excel into an online database, the magic cube net table Excel database
Method 2 of drawing ROC curve in R language: proc package
Vision of building interstellar computing network
捡起MATLAB的第(8)天
Accumulation of applet knowledge points
捡起MATLAB的第(9)天
[open source tool sharing] MCU debugging assistant (oscillograph / modification / log) - linkscope
Upgrade MySQL 5.1 to 5.67
Use bitnami PostgreSQL docker image to quickly set up stream replication clusters
js正則判斷域名或者IP的端口路徑是否正確
C language --- advanced pointer
捡起MATLAB的第(3)天
Import address table analysis (calculated according to the library file name: number of imported functions, function serial number and function name)
Why disable foreign key constraints
一文读懂串口及各种电平信号含义
糖尿病眼底病变综述概要记录