mongodb重新配置分片端口

siv*_*ann 6 sharding mongodb

我已经通过查找他们的.conf文件在非标准端口上重新启动了2个分片.现在,当我通过mongo连接并发出listhards时,我得到:

mongos> db.runCommand( { listshards : 1 } );
Tue Oct 23 17:36:21 uncaught exception: error {
    "$err" : "error creating initial database config information :: caused by :: socket exception [CONNECT_ERROR] for vserver-dev-2:37017",
    "code" : 11002
}
Run Code Online (Sandbox Code Playgroud)

(37017是旧港).如何更新路由器上的分片端口(mongos)?

siv*_*ann 13

手动更新mongo配置服务器上的端口:

    mongo
    use config

    configsvr> db.shards.update({_id: "shard0000"} , {$set: {"host" : "vserver-dev-2:37018"}})
    configsvr> db.shards.find()
    { "_id" : "shard0000", "host" : "vserver-dev-2:37018" }
Run Code Online (Sandbox Code Playgroud)