【问题标题】:Mongodb db.serverStatus().storageEngine are not shownMongodb db.serverStatus().storageEngine 未显示
【发布时间】:2020-09-14 05:20:24
【问题描述】:

我使用的是 4.2.8 版本的 MongoDB

存储引擎是wiredTiger

我输入了db.serverStatus().wiredTiger来监控缓存使用情况,但是storageEngine和wiredTiger字段没有显示。

另一方面,组成standalone可以看到这些字段

我们不能在分片集群模式下检查吗?

这是我的分片服务器和配置服务器配置文件

systemLog:
  verbosity: 0
  traceAllExceptions: true
  path: "~~~~~"
  logAppend: false
  logRotate: "rename"
  destination: "file"
  timeStampFormat: "iso8601-utc"

net:
  port: 20001
  bindIp: "0.0.0.0"

storage:
  dbPath: "~~~~~~"
  journal:
    enabled: true
    commitIntervalMs: 100
  directoryPerDB: true
  engine: "wiredTiger"
  wiredTiger:
    engineConfig:
      cacheSizeGB: 1.0
    collectionConfig:
      blockCompressor: "snappy"
    indexConfig:
      prefixCompression: true

security:
  keyFile: "~~~~~"

sharding:
  clusterRole: "configsvr"

replication:
  replSetName: "config-server"

    systemLog:
      verbosity: 0
      traceAllExceptions: true
      path: "~~~~~~"
      logAppend: false
      logRotate: "rename"
      destination: "file"
      timeStampFormat: "iso8601-utc"
    
    net:
      port: 20002
      bindIp: "0.0.0.0"
    
    storage:
      dbPath: "~~~~"
      journal:
        enabled: true
        commitIntervalMs: 100
      directoryPerDB: true
      engine: "wiredTiger"
      wiredTiger:
        engineConfig:
          cacheSizeGB: 10.0
        collectionConfig:
          blockCompressor: "snappy"
        indexConfig:
          prefixCompression: true
    
    security:
      keyFile: "~~~~~"
    
    sharding:
      clusterRole: "shardsvr"
    
    replication:

  replSetName: "shard1-server"

【问题讨论】:

    标签: mongodb wiredtiger


    【解决方案1】:

    mongos 本身不存储任何数据,这可能是它不报告存储引擎的原因。

    我不知道您是否可以在不同的分片中拥有不同的存储引擎,这在我看来理论上是可行的。

    您可以使用https://docs.mongodb.com/manual/reference/command/listShards/ 来识别分片并查询每个分片的存储引擎。

    【讨论】:

    • 我知道 mongos 没有数据。如果是这样,连接到 mongod --port {port} 和 db.serverStatus() 命令显示字段?
    • 我解决了这个问题。可以通过数据mongo服务器连接而不通过mongos监听
    猜你喜欢
    • 2022-01-22
    • 1970-01-01
    • 2016-10-25
    • 1970-01-01
    • 1970-01-01
    • 2011-04-26
    • 2017-02-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多