当前位置:网站首页>【无标题】
【无标题】
2022-07-28 05:27:00 【yfyh2021】
安装
1.获取安装包
wget https://fastdl.mongodb.org/linux/m2ongodb-linux-x86_64-rhel70-4.4.2.tgz
2.进行解压
tar -xvzf mongodb-linux-x86_64-rhel70-4.4.2.tgz
3.添加到系统执行路径( ~/.bashrc)
export PATH=$PATH:<你机器MongoDB bin目录,如:/usr/local/mongodb/mongodb-linux-x86_64-rhel70-4.4.2/bin>
执行 source ~/.bashrc,使其生效
4.创建数据目录
mkdir -p /data/db # 这个路径是MongoDB默认的数据存放路径
5.启动MongoDB服务
mongod # 如果你不希望使用的默认数据目录可以通过 添加 --dbpath 参数指定路径
前台启动则需要开启另一个窗口进行链接,所以我们使用后台启动
a.后台启动必须创建日志目录,在db文件夹下创建logpath文件夹存放目录
mkdir logpath
b.创建日志文件output.out
touch output.out
c.后台启动
mongod --fork --logpath /data/db/logpath/output.out
出现如下画面启动成功
查看日志

边栏推荐
猜你喜欢

气传导蓝牙耳机怎么样、最值得入手的气传导耳机

Leetcode 刷题日记 剑指 Offer II 053. 二叉搜索树中的中序后继

2022-06-07 responsebodyadvice caused the spring frame problem in swagger

Listener

SSAO By Computer Shader(三)

What are the open earphones? Four types of air conduction earphones with excellent sound quality are recommended

NFT数藏盲盒+模式系统开发

2022-05-24 use of spiel

江中ACM新生10月26日习题题解

2022年七夕礼物推荐!好看便宜又实用的礼物推荐
随机推荐
OJ 1020 minimum palindromes
New Selenium
关于Shader KeyWord的整理
空气传导耳机哪个牌子好、备受好评的气传导耳机推荐
【自我救赎的开始】
新的selenium
2022-05-24 use of spiel
OJ 1131 beautiful number
[c语言]--一步一步实现扫雷小游戏
Solve the problem that the memory occupation is higher than that of the application process
OJ 1242 freshman's debut
Problem solving for ACM freshmen in Jiangzhong on October 26
如何模拟实现strcpy库函数
Get the current directory in QT
MFC uses the console to print program information
[队列,栈的简单应用----包装机]
2022-07-17 Damon database installation
OJ 1505 保险丝
pyppeteer 下拉 selenium下拉
OJ 1284 记数问题