Why not make every node a seed node

前端 未结 1 1061
猫巷女王i
猫巷女王i 2021-02-20 15:05

Im a Cassandra newbie. I understand the purpose of the seed node. But are there any costs associated with a seed node? If so, what are they. Else, I wondering why just not make

相关标签:
1条回答
  • 2021-02-20 15:56

    There are essentially no local runtime costs associated with being a seed, other than you may receive more gossip traffic than a non-seed node. However with increasing number of seeds, this local effect will be progressively less pronounced.

    More interesting are distributed effects. Seed nodes are favored for gossiping, which means that if there are only a few of them, updates will be concentrated among those few seeds. Non-seed nodes will try to send gossip updates to the seeds (picking randomly from their seed list), and so if everyone sends updates to the same few nodes, they are bound to have the most recent cluster metadata. At the same time, gossiping also involves receiving metadata from the seeds, which means that everyone who gossips with the few seed nodes will also benefit from the most recent updates. The end result is that updates are disseminated relatively quickly throughout the cluster, at the cost of concentrating some of the gossip traffic on fewer nodes.

    Compare that to a situation where every node is a seed. When some node gossips, it essentially talks to another random node in the cluster, which is not any likelier to gossip with the rest of the cluster. So the update that our first node just sent to the "seed" is not going to propagate around especially quickly. Furthermore, because the seed does not receive a larger proportion of all gossip updates, the info it is able to send back to our node is not particularly up-to-date either (in fact both nodes would have approximately the same probability of not knowing about some disconnected update in the cluster). So we get full decentralization, but with completely random update propagation.

    In real terms, if you have a large number of seeds, you may be subject to flapping, ghosting and other strange behaviors related to old topology info persisting for longer than it should.

    0 讨论(0)
提交回复
热议问题