简体   繁体   English

EC2上的datastax cassandra集群 - 节点如何找到彼此?

[英]datastax cassandra cluster on EC2 - how do nodes find each others?

I followed Datastax instruction to set a cluster on EC2 http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installAMILaunch.html all is working fine and cluster is created. 我按照Datastax指令在EC2上设置了一个集群http://www.datastax.com/documentation/cassandra/2.0/cassandra/install/installAMILaunch.html一切正常,集群已创建。

My question is how? 我的问题是怎么样? How does the instances know each other IP? 实例如何相互知道IP? Initially I assumed it is read from meta-data, but I did not find the info there. 最初我假设它是从元数据中读取的,但我没有在那里找到信息。

Cassandra uses "seed nodes" to propagate node topology information to the whole cluster, including addresses of all the nodes. Cassandra使用“种子节点”将节点拓扑信息传播到整个群集,包括所有节点的地址。 According to the DataStax documentation , AMI sets all the seed nodes. 根据DataStax文档 ,AMI设置所有种子节点。 I would expect that AMI modifies each node's cassandra.yaml file to configure those seed nodes. 我希望AMI修改每个节点的cassandra.yaml文件来配置这些种子节点。

Edit: 编辑:

It finds the seed nodes because you configure them in the cassandra.yaml file on each node when you create your cluster, or AMI does it on your behalf. 它找到种子节点,因为您在创建群集时在每个节点上的cassandra.yaml文件中配置它们,或者AMI代表您执行此操作。 As each node comes up, it looks in its cassandra.yaml for the list of seed nodes, contacts them, and they provide the list of all the nodes they know about. 当每个节点出现时,它会在其cassandra.yaml中查找种子节点列表,与它们联系,并提供他们所知道的所有节点的列表。 In other words, all the nodes that have contacted them. 换句话说,所有已联系它们的节点。 As new nodes join, there presence is propagated through the cluster, and the seed nodes keep the master list. 当新节点加入时,存在通过集群传播,种子节点保留主列表。

I believe I have an answer: Reflector, a centralize datastax service getting requests from each server and group by reservation id. 我相信我有一个答案:Reflector,一个集中式数据传输服务,通过预留ID从每个服务器和组获取请求。 After some time, each can query and get the IP of the other members. 一段时间后,每个人都可以查询并获取其他成员的IP。

"The reflector is used to keep track of which IPs are in the cluster of DSE/C that is being initiated. The reflector receives the internal IP address, the public dns, the reservation id, and the clustername to keep track of the clusters' seeds. This data is saved to a SQLite database. If another request to the php file is sent after 5 minutes of inactivity, the database is cleared and started fresh to keep the list of IPs as fresh as possible to avoid conflicts and keep your privacy." “反射器用于跟踪正在启动的DSE / C群集中的哪些IP。反射器接收内部IP地址,公共DNS,预留ID和群集名称以跟踪群集”这个数据保存到SQLite数据库。如果在5分钟不活动后发送另一个对php文件的请求,数据库将被清除并重新开始,以保​​持IP列表尽可能新,以避免冲突并保护您的隐私“。

The call to the reflector is in https://github.com/riptano/ComboAMI/blob/2.5/ds2_configure.py#L445 对反射器的调用在https://github.com/riptano/ComboAMI/blob/2.5/ds2_configure.py#L445

Basically, you have opened some tcp ports for their connection. 基本上,您已为其连接打开了一些tcp端口。 7000 port is used for internal node communication. 7000端口用于内部节点通信。 And 9042 is used for CQL native transport. 9042用于CQL本机传输。

So you can check these ports in your command line. 因此,您可以在命令行中检查这些端口。 They all should be opened. 他们都应该被打开。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 连接到EC2 Ruby on Rails上datastax集群上的cassandra节点 - connecting to cassandra nodes on a datastax cluster on EC2 Ruby on Rails Datastax-Cassandra Amazon EC2多区域设置-具有3个节点的群集 - Datastax - Cassandra Amazon EC2 Multiregion Setup - Cluster with 3 node 无法在EC2 AMI上将节点添加到现有集群cassandra datastax - Cannot add a node to an existing cluster cassandra datastax on EC2 AMI EC2 Cassandra 集群节点上的 CQLSH 连接被拒绝 - CQLSH connection refused on EC2 Cassandra cluster nodes Datastax Cassandra Community EC2备份方法 - Datastax Cassandra Community EC2 backup methods Datastax Cassandra-Amazon EC2实例-具有跨越整个Amazon区域的三个节点的集群 - Datastax Cassandra - Amazon EC2 instance - Cluster with three node spanning across Amazon region EC2中的Cassandra群集通过私有IP与自身通信。 我该如何与外界沟通? - Cassandra cluster in EC2 communicates to itself over private IP. How do I communicate with it from the outside? 如何在两台ec2机器上部署Cassandra集群? - How to deploy a Cassandra cluster on two ec2 machines? EC2上的Cassandra Datastax AMI-从“停止” /“开始”中恢复 - Cassandra Datastax AMI on EC2 - Recover from “Stop”/“Start” EC2 DataStax AMI V2.5错误(Opscenter Cassandra) - EC2 DataStax AMI V2.5 Error (Opscenter Cassandra)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM