当前位置:网站首页>下载并安装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
边栏推荐
- Load Balancer
- 新动态:SmartMesh和MeshBox的合作新动向
- R语言中绘制ROC曲线方法二:pROC包
- Use bitnami PostgreSQL docker image to quickly set up stream replication clusters
- js正則判斷域名或者IP的端口路徑是否正確
- Application of Bloom filter in 100 million flow e-commerce system
- Day (10) of picking up matlab
- String sorting
- Multi level cache usage
- One brush 313 sword finger offer 06 Print linked list from end to end (E)
猜你喜欢
随机推荐
Coalesce and repartition of spark operators
幂等性的处理
Application of Bloom filter in 100 million flow e-commerce system
为啥禁用外键约束
String sorting
Why disable foreign key constraints
Config组件学习笔记
dlopen/dlsym/dlclose的简单用法
捡起MATLAB的第(7)天
多级缓存使用
Metalife established a strategic partnership with ESTV and appointed its CEO Eric Yoon as a consultant
TIA博图——基本操作
Groupby use of spark operator
保姆级Anaconda安装教程
Go language, array, pointer, structure
Import address table analysis (calculated according to the library file name: number of imported functions, function serial number and function name)
实现缺省页面
【第5节 if和for】
Modèle de Cluster MySQL et scénario d'application
leetcode-374 猜数字大小









