minhhungit / mongodb-cluster-docker-compose

docker-compose for mongodb cluster sharded with replication
MIT License
495 stars 196 forks source link

I got error in getShardDistribution. #19

Closed erdinccurebal closed 1 year ago

erdinccurebal commented 1 year ago

Hi, i got an error like this.

mongos> db.articles.getShardDistribution(); Collection news.articles is not sharded.

minhhungit commented 1 year ago

@erdinccurebal I think that's because you have not enable sharding or creating shard key for articles collection, check this step https://github.com/minhhungit/mongodb-cluster-docker-compose#-step-4-enable-sharding-and-setup-sharding-key-

erdinccurebal commented 1 year ago

I will try again by making a video, if not, I will share the video with you.