Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当我启动mongodb.runCommand…主机已使用错误调用~_Mongodb - Fatal编程技术网

当我启动mongodb.runCommand…主机已使用错误调用~

当我启动mongodb.runCommand…主机已使用错误调用~,mongodb,Mongodb,我怎样才能解决这个问题?这是“主机已使用”错误 请告诉我解决此问题的技巧~根据mongodb,此消息表示您已将此指定主机:端口添加为碎片: db.runCommand({addshard:"localhost:10000"}); { "ok" : 0, "errmsg" : "host already used" } db.runCommand( { addshard : "localhost:10001" } ); { "ok" : 0, "errmsg" : "host already us

我怎样才能解决这个问题?这是“主机已使用”错误

请告诉我解决此问题的技巧~

根据mongodb,此消息表示您已将此指定主机:端口添加为碎片:

db.runCommand({addshard:"localhost:10000"});
{ "ok" : 0, "errmsg" : "host already used" }
db.runCommand( { addshard : "localhost:10001" } );
{ "ok" : 0, "errmsg" : "host already used" }
根据mongodb,此消息表示您已将此指定的主机:端口添加为碎片:

db.runCommand({addshard:"localhost:10000"});
{ "ok" : 0, "errmsg" : "host already used" }
db.runCommand( { addshard : "localhost:10001" } );
{ "ok" : 0, "errmsg" : "host already used" }

在js shell中运行
sh.status()
,它应该为您提供有关碎片状态的信息。在js shell中运行
sh.status()
,它应该为您提供有关碎片状态的信息。
db.runCommand( { listshards : 1 } );