MongoDB 分片集群上的 运行 sh.status() 命令出现异常

Getting exception on running sh.status() command on MongoDB sharded cluster

我在 运行 sh.status() 我的分片 Mongo 集群的 mongos 实例上执行命令,我遇到异常。

mongos> sh.status()
assert: command failed: {
    "ok" : 0,
    "errmsg" : "error processing query: ns=config.mongosTree: ping $gt new Date(1542173873192)\nSort: {}\nProj: {}\n No query solutions",
    "code" : 2
} : aggregate failed
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:16:14
assert.commandWorked@src/mongo/shell/assert.js:290:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1312:5
printShardingStatus@src/mongo/shell/utils_sh.js:611:13
sh.status@src/mongo/shell/utils_sh.js:78:5
@(shell):1:1

2018-11-14T05:38:55.904+0000 E QUERY    [thread1] Error: command failed: {
    "ok" : 0,
    "errmsg" : "error processing query: ns=config.mongosTree: ping $gt new Date(1542173873192)\nSort: {}\nProj: {}\n No query solutions",
    "code" : 2
} : aggregate failed :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
doassert@src/mongo/shell/assert.js:16:14
assert.commandWorked@src/mongo/shell/assert.js:290:5
DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1312:5
printShardingStatus@src/mongo/shell/utils_sh.js:611:13
sh.status@src/mongo/shell/utils_sh.js:78:5
@(shell):1:1

我是 运行 Mongo 3.2 ubuntu 16.04 平台。它在 ubuntu 14.04 平台上的 MongoDB 3.0 版上运行良好。我已经重新安装了所有东西并在新机器上也试过了,一切正常,除了 sh.status() 命令。

谢谢。

这是因为 notablescan 属性 在我的 mongo 配置服务器中启用。禁用 notablescan 后,命令运行正常。您可以通过 运行 此命令检查 notablescan 的状态。

db.adminCommand( { getParameter: 1, notablescan: 1 } )

如果启用 notablescan,输出将如下所示。

{
  "notablescan": true,
  "ok": 1
}