turms-im / turms

🕊️ The world's most advanced open source instant messaging engine for 100K~10M concurrent users https://turms-im.github.io/docs
Apache License 2.0
1.75k stars 271 forks source link

Running Spring Boot project directly failed. #1100

Closed yudoutingle closed 1 year ago

yudoutingle commented 1 year ago

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?

JamesChenX commented 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:

yudoutingle commented 1 year ago

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.!