当前位置:网站首页>下载并安装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
边栏推荐
- Extract non duplicate integers
- Named in pytoch_ parameters、named_ children、named_ Modules function
- Spark 算子之coalesce与repartition
- C language --- advanced pointer
- PS add texture to picture
- Fastjon2 here he is, the performance is significantly improved, and he can fight for another ten years
- [section 5 if and for]
- Modèle de Cluster MySQL et scénario d'application
- The biggest winner is China Telecom. Why do people dislike China Mobile and China Unicom?
- API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)
猜你喜欢
Application of Bloom filter in 100 million flow e-commerce system
C language --- advanced pointer
Single architecture system re architecture
Neodynamic Barcode Professional for WPF V11.0
One brush 314 sword finger offer 09 Implement queue (E) with two stacks
CAP定理
多线程原理和常用方法以及Thread和Runnable的区别
Implement default page
Construction of esp32 compilation environment
一文掌握vscode远程gdb调试
随机推荐
VIM specifies the line comment and reconciliation comment
How can poor areas without networks have money to build networks?
CVPR 2022 quality paper sharing
实现缺省页面
Pgpool II 4.3 Chinese Manual - introductory tutorial
[section 5 if and for]
【现代电子装联期末复习要点】
PS为图片添加纹理
Upgrade MySQL 5.1 to 5.611
Treatment of idempotency
JS regular détermine si le nom de domaine ou le chemin de port IP est correct
多级缓存使用
Fastjon2 here he is, the performance is significantly improved, and he can fight for another ten years
捡起MATLAB的第(3)天
Large factory technology implementation | industry solution series tutorials
The biggest winner is China Telecom. Why do people dislike China Mobile and China Unicom?
Go concurrency and channel
ESP32编译环境的搭建
MySQL optimistic lock to solve concurrency conflict
Spark 算子之partitionBy