Cassandra 种子节点和连接到节点的客户端 [英] Cassandra seed nodes and clients connecting to nodes

查看:29
本文介绍了Cassandra 种子节点和连接到节点的客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 Cassandra 种子节点以及客户端如何连接到集群有点困惑.我似乎无法在文档中找到这一点信息.

客户端是否只包含种子节点的列表并且每个节点都委派一个新的主机供客户端连接?种子节点真的只是用于节点到节点的发现,而不是用于客户端的特殊节点吗?

每个客户端是否应该使用 DC 中的一小部分随机节点来连接?

或者,每个客户端是否应该使用 DC 中的所有节点?

解决方案

回答我自己的问题:

种子

来自常见问题:><块引用>

在启动期间使用种子来发现集群.

同样来自关于八卦"的 DataStax 文档:

<块引用>

除了引导八卦过程之外,种子节点指定没有任何用途用于加入集群的新节点.种子节点不是单一的故障点,也没有任何其他特殊目的节点引导之外的集群操作.

从这些细节来看,种子对客户来说似乎没什么特别的.

客户

来自关于客户端请求的 DataStax 文档:

<块引用>

Cassandra 中的所有节点都是对等节点.客户端读取或写入请求可以转到集群中的任何节点.当客户端连接到节点并且发出读或写请求,该节点充当协调器用于特定的客户端操作.

协调器的工作是充当客户端之间的代理应用程序和拥有数据的节点(或副本)要求.协调器确定环中的哪些节点应该根据集群配置的分区器获取请求和副本放置策略.

我认为客户端连接的节点池可能只是 DC 中的少数(随机?)节点,以允许潜在的故障.

I'm a little confused about Cassandra seed nodes and how clients are meant to connect to the cluster. I can't seem to find this bit of information in the documentation.

Do the clients only contain a list of the seed node and each node delegates a new host for the client to connect to? Are seed nodes only really for node to node discovery, rather than a special node for clients?

Should each client use a small sample of random nodes in the DC to connect to?

Or, should each client use all the nodes in the DC?

解决方案

Answering my own question:

Seeds

From the FAQ:

Seeds are used during startup to discover the cluster.

Also from the DataStax documentation on "Gossip":

The seed node designation has no purpose other than bootstrapping the gossip process for new nodes joining the cluster. Seed nodes are not a single point of failure, nor do they have any other special purpose in cluster operations beyond the bootstrapping of nodes.

From these details it seems that a seed is nothing special to clients.

Clients

From the DataStax documentation on client requests:

All nodes in Cassandra are peers. A client read or write request can go to any node in the cluster. When a client connects to a node and issues a read or write request, that node serves as the coordinator for that particular client operation.

The job of the coordinator is to act as a proxy between the client application and the nodes (or replicas) that own the data being requested. The coordinator determines which nodes in the ring should get the request based on the cluster configured partitioner and replica placement strategy.

I gather that the pool of nodes that a client connects to can just be a handful of (random?) nodes in the DC to allow for potential failures.

这篇关于Cassandra 种子节点和连接到节点的客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆