数据库
首页 > 数据库> > mongoDB生产环境部署注意事项之dbPath配置

mongoDB生产环境部署注意事项之dbPath配置

作者:互联网

dbPath目录中的文件必须与配置的存储引擎对应。如果dbPath文件存储路径包含由--storageEngine指定的存储引擎以外的存储引擎创建的数据文件,mongod将不会启动。

mongod必须对指定的文件存储路径拥有读写权限。

storage.dbPath选项

storage:

   dbPath: <string>

在Linux和macOS平台上,默认值/data/db

在Windows上为\data\db

该路径为mongod实例存储其数据的目录。

storage.dbPath设置仅适用于mongod。

如果是使用系统软件包管理器安装mongodb,其中包含的默认mongod.conf配置文件对storage.dbPath使用以下特定于平台的默认值:

平台

包管理器

storage.dbPath默认值

RHEL/CentOS和亚马逊

yum

/var/lib/mongo

SUSE

zypper

/var/lib/mongo

Ubuntu和Debian

apt

/var/lib/mongodb

maxOS

brew

/usr/local/var/mongodb

 

Linux软件包初始化脚本不希望storage.dbPath更改为默认值。如果使用Linux软件包并更改storage.dbPath,则必须使用自己的初始化脚本并禁用内置脚本。

翻译自:https://docs.mongoing.com/guan-li/production-notes

标签:mongod,dbPath,mongoDB,storage,存储,注意事项,var,默认值
来源: https://blog.csdn.net/bg1017759447/article/details/115028965