简体   繁体   English

Datastax-Cassandra Amazon EC2多区域设置-具有3个节点的群集

[英]Datastax - Cassandra Amazon EC2 Multiregion Setup - Cluster with 3 node

I have launched 3 Amazon EC2 instance and setup datastax cassandra as follows 我已经启动了3个Amazon EC2实例并设置datastax cassandra如下

1.Region - US EAST: 1.地区-美国东部:

cassandra.yaml - configuration cassandra.yaml-配置

a.listen_address as private IP of this instance a.listen_address作为此实例的私有IP

b.broadcast_address as public IP of this instance b.broadcast_address作为此实例的公共IP

c.seeds as 50.XX.XX.X1, 50.XX.XX.X2 (public-ip of node1,public-ip of node2) c.seeds为50.XX.XX.X1、50.XX.XX.X2(node1的public-ip,node2的public-ip)

cassandra-rackdc.properties - configuration cassandra - rackdc.properties-配置

dc=DC1 dc = DC1

rack=RAC1 机架= RAC1

dc_suffix=US_EAST_1 dc_suffix = US_EAST_1

2.Region - US WEST: 2.地区-美国西部:

I did same procedure as I did above. 我执行了与上述相同的步骤。

3.Region - EU IRELAND: 3.地区-欧盟爱尔兰:

The result of above configuration is 以上配置的结果是

All the node working good individually. 所有节点都单独工作良好。 But when I do 但是当我这样做

$nodetool status on all the three node 所有三个节点上的$ nodetool状态

It only listing the local node only. 它仅列出本地节点。

I tried to achieve the following things. 我试图实现以下目标。

1. Launch 3 cassandra node in three different region. 1.在三个不同的区域中启动3个cassandra节点。 For say, US-EAST,US-WEST,EU-IRELAND. 例如,美国东部,美国西部,欧盟爱尔兰。

  1. With Following configuration or methodology 使用以下配置或方法

    a.Ec2MultiRegionSnitch a.Ec2MultiRegionSnitch

    b.Replication staragey as SimpleStrategy b。繁琐的复制作为SimpleStrategy

    c.Replication Factor as 3 c。复制因子为3

    d. d。 Read & write level as QUORUM. 读取和写入级别为QUORUM。

  2. I wish to attain only one thing ie if any two of the region is down or any two of the node down, I can survive with renaming one node. 我只想实现一件事,即如果该区域的任何两个关闭或该节点的任何两个关闭,我都可以重命名一个节点。

My Questions here are 我的问题是

Where I did the mistake? 我在哪里弄错了? and How to attain my requirements? 以及如何达到我的要求?

Any help or inputs are much appreciated. 任何帮助或投入,我们将不胜感激。

Thanks. 谢谢。

This is what worked for me with cassandra 3.0 这就是cassandra 3.0对我有用的原因

endpoint_snitch: Ec2MultiRegionSnitch
listen_address: <leave_blank>
broadcast_address: <public_ip_of_server>
rpc_address: 0.0.0.0
broadcast_rpc_address: <public_ip_of_server>
-seed: "one_ip_from_other_DC"

Finally, I found the resolution of my issue. 最后,我找到了解决问题的方法。 I am using replication strategy as SimpleStrategy, hence I do not require to configure cassandra-rackdc.properties . 我将复制策略用作SimpleStrategy,因此不需要配置cassandra-rackdc.properties

Once, I removed the file cassandra-rackdc.properties from all node, Everything working as expected. 一次,我从所有节点上删除了文件cassandra-rackdc.properties,一切正常。

Thanks 谢谢

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM