0
votes

This is not a technical question, although I need help. For a school project, I set up a mongodb sharded cluster. Now I have to do a video that demonstrates sharding. I could run a program that fills up the first shard and then show that, when needed, data are balanced over the second shard. However, this would take a very very long time. I thought about running a command that would calculate the available disk space of a mongodb sharded cluster (with one shard, then with two shards) but there is no such command.

Any creative help would be great !

EDIT: A good way is to set the chunck size to something really low, sharding will be shown quick enough with a script filling up the database

1
What are you trying to do? What is the point of getting total space in a clsuter? There is no real reason to your question - Sammaye
the only reason of my question is to be advised of a good way to demonstrate the scalability provided by sharding. Have you even read the question ? - rmonjo
Yes but I didn't get that idea from your question, measuring the total disk size on a cluster wont prove nothing - Sammaye
WHat you wanna do is do a set of tests that balances chunnks to the ratio of insertions into your database and check that MongoDB correctly balances them across the cluster. You then want to write down your observations about a good shard key and how a bad shard key ruins the scaling and etc etc etc, atm you are looking into an area that will prove nothing about what your asking about - Sammaye
did I mention shard key ? Just want to show storage scalability. That would be proven if I could get the total disk space available within a cluster. - rmonjo

1 Answers

1
votes

You might find this open source project helpful:

MongoDB Sharding Visualizer

The source is here: https://github.com/10gen-labs/shard-viz