【发布时间】:2017-08-13 10:04:08
【问题描述】:
我在 AWS (EC2) 上部署了一个 3 节点 Cassandra 集群。我正在尝试从我的计算机上运行的 .NET 控制台应用程序连接到集群。 Datastax 网站提供了以下用于连接本地实例的代码示例:
Cluster cluster = Cluster.Builder().AddContactPoint("127.0.0.1").Build();
我已设置 cassandra.yaml,以便 nodetool status 将节点的地址显示为 EC2 实例的私有 IP 地址。但是,如果我在 AddContactPoint() 函数中使用私有地址,.NET 驱动程序会返回一个错误,指出 none of the hosts tried for query are available。
您在 AddContactPoint() 函数中使用哪个 IP 地址(而不是 127.0.0.1)连接到 AWS 中的 Cassandra 集群? EC2 实例的公有或私有 IP 地址?还是别的什么?
我在 cassandra.yaml 中的设置是:
rpc_address: 0.0.0.0
broadcast_rpc_address: *EC2's public IP address*
listen_address: *EC2's private IP address*
提前致谢。
【问题讨论】:
标签: .net amazon-web-services amazon-ec2 cassandra