Windows系统中的安装启动--服务端启动
2022/4/10 7:12:36
本文主要是介绍Windows系统中的安装启动--服务端启动,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
将压缩包解压到一个目录中。 在解压目录中,手动建立一个目录用于存放数据文件,如 data/db
方式1:命令行参数方式启动服务 在 bin 目录中打开命令行提示符,输入如下命令: mongod --dbpath=..\data\db
配置文件方式启动服务 在解压目录中新建 config 文件夹,该文件夹中新建配置文件 mongod.conf ,内如参考如下: storage: #The directory where the mongod instance stores its data.Default Value is "\data\db" on Windows. dbPath: D:\mongodb-win32-x86_64-2008plus-ssl-4.0.28\data
【注意】 1)配置文件中如果使用双引号,比如路径地址,自动会将双引号的内容转义。如果不转义,则会报错: error-parsing-yaml-config-file-yaml-cpp-error-at-line-3-column-15-unknown-escape-character-d 解决: a. 对 \ 换成 / 或 \\ b. 如果路径中没有空格,则无需加引号。 2)配置文件中不能以Tab分割字段
启动方式: mongod -f ../config/mongod.conf 或mongod --config ../config/mongod.conf
systemLog: destination: file #The path of the log file to which mongod or mongos should send all diagnostic logging information path: "D:/02_Server/DBServer/mongodb-win32-x86_64-2008plus-ssl-4.0.1/log/mongod.log" logAppend: true storage: journal: enabled: true #The directory where the mongod instance stores its data.Default Value is "/data/db". dbPath: "D:/02_Server/DBServer/mongodb-win32-x86_64-2008plus-ssl-4.0.1/data" net: #bindIp: 127.0.0.1 port: 27017 setParameter: enableLocalhostAuthBypass: false
这篇关于Windows系统中的安装启动--服务端启动的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-15鸿蒙生态设备数量超8亿台
- 2024-05-13TiDB + ES:转转业财系统亿级数据存储优化实践
- 2024-05-09“2024鸿蒙零基础快速实战-仿抖音App开发(ArkTS版)”实战课程已上线
- 2024-05-09聊聊如何通过arthas-tunnel-server来远程管理所有需要arthas监控的应用
- 2024-05-09log4j2这么配就对了
- 2024-05-09nginx修改Content-Type
- 2024-05-09Redis多数据源,看这篇就够了
- 2024-05-09Google Chrome驱动程序 124.0.6367.62(正式版本)去哪下载?
- 2024-05-09有没有大佬知道这种数据应该怎么抓取呀?
- 2024-05-09这种运行结果里的10.100000001,怎么能最快改成10.1?