Closed yudoutingle closed 1 year ago
From the information that you provided, It seems that you configured the MongoDB sharded cluster correctly, turms should have worked.
And the error ShardNotFound
usually happens when you just start the Mongo sharding cluster and start turms servers BEFORE the MongoDB shard server is registered into the mongos server.
So after you set up the MongoDB sharded cluster, you better wait for seconds to ensure the MongoDB shard cluster is really ready and start turms servers again.
Bonus:
You can use the command to ensure your MongoDB sharded cluster is set up properly, and I have used the command for years on multiple computers.
mlaunch init --replicaset --sharded 1 --nodes 1 --config 1 --hostname localhost --port 27017 --mongos 1
To check whether the MongoDB sharded cluster is ready or not, you can use the command:
mongo -u <user> -p <password> --port <port> --eval "sh.status()"
And there is an output field called shards
which should contain not empty shards. For example:
shards:
{ "_id" : "shard01", "host" : "shard01/localhost:29018", "state" : 1, "topologyTime" : Timestamp(1667857346, 3), "tags" : [ "hot", "warm", "cold", "frozen" ] }
Thanks a lot. I rm data and execute command ‘mlaunch init xxx’ again, it works well. This appears to be a sporadic problem caused by mlaunch init The issue can be closed. Thanks again.!
HI, I config mongo cluster with mlaunch in default port , then starting turms-server main mathod in dev profiles, and it comes out that:
mongo cluster work well, and i can connect it by mongo compass.
My mongo cluster status:
C:\Users\41011>mlaunch list --dir data Detected mongod version: 5.0.14
PROCESS PORT STATUS PID mongos 27017 running 18628 config server 27019 running 8308 shard01 mongod 27018 running 13956
this really confused me, and i have no idea what to do now. can you help me?