MongoDB Only one chunk when sharding

Hello!

I followed the tutorial about sharding and when I ran all the commands it only created one chunk.
{ “name” : { “$minKey” : 1 } } -->> { “name” : { “$maxKey” : 1 } } on : m103-example Timestamp(1, 0)
First I tried to use “sku” as the shard key but it had the same result.
I have two shards like in the tutorials.
shards:
{ “_id” : “m103-example”, “host” : “m103-example/192.168.1.65:27001,192.168.1.65:27002,192.168.1.65:27003”, “state” : 1 }
{ “_id” : “m103-shard-2”, “host” : “m103-shard-2/192.168.1.65:28001,192.168.1.65:28002,192.168.1.65:28003”, “state” : 1 }

Please show full output of sh.status()
Which lab is this
Is the replicaset name m103-example or m103-repl?Check your lab requirements again
What IP is 192.168.1.65?
Are you using IDE or trying it on your local host?
Use IDE for this course and localhost for bindip

2 Likes

Hi @Mate_Benke,

Welcome to the MongoDB Community forum.

As @Ramachandra_Tummala stated, we should be needing some more intel from your side to get your issue resolved. And, we will suggest you use our inbuilt IDE for this course if you are not using it yet.

Thanks
Kushagra

2 Likes

I managed to resolve the issue :smiley:, the default chunksize was too big to split.

Hi @Mate_Benke,

We are so glad that your problem has been solved.

Talking about the default chunk size for a sharded cluster, it is 64 megabytes. This default chunk size works well for most deployments; however, if you had noticed the automatic migrations had more I/O than your hardware can handle, then you may have to reduce the chunk size.

You can read more about modifying chunk size here

Regards
Kushagra

2 Likes