7

My first question is really simple, I just want to know if I can mix Linux and Windows mongodb servers in my sharding/replica cluster, ofc with same version like 2.2?

For 2nd question, can someone explain what heppens if I have sharding servers with this hardware

  • Server 1 : High Cpu, SSD disk
  • Server 2 : Normal CPU, Sata disk
  • Server 3 : Normal CPU , SSD disk

How will sharding work when we have different hardware servers?

Is it important to build clusters on machines with almost the same hardware?

4

1 回答 1

7

There shouldn't be a problem mixing Linux and Windows servers, assuming (as you stated) that the MongoDB versions are equivalent.

Regarding differences in hardware, MongoDB tries to distribute data evenly across shards, and each server will use as many available resources as possible to give the best performance possible. When another process on a server requests some resources, Mongo will relinquish those resources. This will usually mean swapping some data to disk until more RAM becomes available again.

Because your servers will do this, and other operations, at different speeds, the important question becomes "What happens when one server in a shard is running slowly". According to the FAQ:

If a shard is responding slowly, mongos will merely wait for the shard to return results.

So in practice, parts of your sharded collections will be slower than others, but everything should work just fine. You would probably have a better experience if the hardware matched, but it doesn't have to.

于 2012-09-09T20:30:26.040 回答