Writes across sharded replica set with 2 shards causes strange reads of the same volume on the primary of the second shard
I realize that question is confusing. I'm testing my sharding topology and I have:
Shard A ( node1(primary), node2(secondary), node3(secondary) )
Shard B ( node4(primary), node5(secondary), node6(secondary) )
With 0 database activity, if I begin writing a lot of data to a sharded collection I see all of the write activity on all of the nodes in shard A ( because this particilar chunk is being written there ). The strange part is, on node4 ( the primary in shard B ) I see the same volume of rea开发者_运维百科d queries being made at the same time that the writes are being made to shard A. What could be causing this behavior?
If all of the writes are going to Shard A, then the only major activity you should see is on those nodes. (i.e.: writes to node1, getmores to node2/3).
Two big questions:
- How are you getting the stats? (
mongostat
?) - Is your import process checking for existing entries before inserting? Is it possible that you're sending queries that need to run against both shards? Any query not on the shard key could cause a query to go to both (all) shards.
精彩评论