解析命令行时出错:无法识别的选项“--configdb”
Error parsing command line: unrecognised option '--configdb'
我正在学习 this 教程,该教程解释了如何在 windows
设置 mongodb shard
。在第 3 步中,它表示使用命令
启动路由进程
mongod --port 40000 --configdb localhost:27100 --logpath=/www/mongoDB/shard/log/route.log --chunkSize 500
和windows console
returns:
Error parsing command line: unrecognised option '--configdb' try
'mongod --help' for more information
我试过 mongod --help
,我发现 --configdb
对于 mongod
确实不存在。我怎样才能完成这一步或解决这个错误?
我阅读了 other 教程,在第 2 步中它使用了与 configdb
相同的 mongod
mongod –configdb ServerD: 27019
我正在使用 MongoDB v3.4
。
看起来本教程适用于 3.4 之前的版本。从 3.4 开始,config databases 本身就是一个副本集(因为数据不丢失非常重要)。
有一个 official tutorial for 3.4 更详细,适用于最新版本。
总而言之,您的 --configdb
值最终会像 <configReplSetName>/cfg1.example.net:27019,cfg2.example.net:27019
您必须使用 mongos
instead of mongod
。
官方教程:https://docs.mongodb.com/manual/tutorial/deploy-shard-cluster/
我正在学习 this 教程,该教程解释了如何在 windows
设置 mongodb shard
。在第 3 步中,它表示使用命令
mongod --port 40000 --configdb localhost:27100 --logpath=/www/mongoDB/shard/log/route.log --chunkSize 500
和windows console
returns:
Error parsing command line: unrecognised option '--configdb' try 'mongod --help' for more information
我试过 mongod --help
,我发现 --configdb
对于 mongod
确实不存在。我怎样才能完成这一步或解决这个错误?
我阅读了 other 教程,在第 2 步中它使用了与 configdb
mongod
mongod –configdb ServerD: 27019
我正在使用 MongoDB v3.4
。
看起来本教程适用于 3.4 之前的版本。从 3.4 开始,config databases 本身就是一个副本集(因为数据不丢失非常重要)。
有一个 official tutorial for 3.4 更详细,适用于最新版本。
总而言之,您的 --configdb
值最终会像 <configReplSetName>/cfg1.example.net:27019,cfg2.example.net:27019
您必须使用 mongos
instead of mongod
。
官方教程:https://docs.mongodb.com/manual/tutorial/deploy-shard-cluster/