如何显示当前运行的 mongod 的配置文件路径和 db 文件路径?



我想查看当前运行的mongod的配置文件路径和db文件路径,如何通过mongo命令实现?

这样行吗?

use local;
db.startup_log.find({}, { _id:0, hostname:1, startTime:1, cmdLine:1})
              .sort({startTime:-1}).limit(1)

结果对我来说是这样的(在我的命令行中没有配置文件):

{ 
  "hostname" : "maxime", 
  "startTime" : ISODate("2015-09-29T12:10:21Z"), 
  "cmdLine" : { "storage" : { "dbPath" : "data/" } } 
}

最新更新