mongos mongo 3.4.2 中的块大小错误

mongos chunksize error in mongo 3.4.2

我有 mongo 版本 3.4.2,我有以下命令:

mongos --configdb localhost:27016 --chunkSize 1 --port 27020

它在我的 mongo 版本中不起作用。有人可以帮忙解决吗? 顺便说一下,我不想降级到以前版本的 mongo。 它曾经在以前的版本(例如 3.2)下工作。

您不能再使用 --chunkSize 选项。

来自 3.4 发行说明:

MongoDB 3.4 removes the following configuration options from the mongos: sharding.chunkSize configuration file setting and --chunkSize command-line option sharding.autoSplit configuration file setting and --noAutoSplit command line option

您必须使用 here 中描述的过程来修改区块大小:

use config
db.settings.save( { _id:"chunksize", value: 1 } )