【问题标题】:Unable to connect Cassandra Test Cluster无法连接 Cassandra 测试集群
【发布时间】:2014-06-14 15:35:13
【问题描述】:

我在 Ubuntu 上创建了 1 个节点 Cassandra 集群(datastax 企业),我可以通过 cqlsh 连接到该集群,但是当我尝试通过 OpsCenter 或通过 c# 驱动程序从 VS2012 连接时,我收到类似“无法连接到集群”的错误" 或 "所有尝试查询的主机都出错",谁能帮我解决这个错误?

编辑:

我按照“datastax.com/documentation/datastax_enterprise/4.0/…”中给出的说明安装了 datastax Enterprise,并且在 yaml 文件中除了集群名称外,所有键的默认值都具有。当我运行 cqlsh 时,它连接到此消息:

Connected to fptestcluster at localhost:9160.
[cqlsh 4.1.1 | Cassandra 2.0.6.28 | CQL spec 3.1.1 | Thrift protocol 19.39.0]

但如原始问题中所述,使用 OpsCenter 和 C# 驱动程序我无法连接。

【问题讨论】:

  • 你能描述得更详细一点吗?可能描述了您如何配置集群?
  • 我按照“datastax.com/documentation/datastax_enterprise/4.0/…”中给出的说明安装了datastax Enterprise,并在yaml文件中设置了除集群名称外的所有键的默认值。当我运行 cqlsh 时,它会显示以下消息“连接到 fptestcluster at localhost:9160。[cqlsh 4.1.1 | Cassandra 2.0.6.28 | CQL 规范 3.1.1 | Thrift 协议 19.39.0]”,但正如 OpsCenter 的原始问题中所指定和 C# 驱动程序我无法连接。
  • 使用 opscenter 和驱动的端口与使用 cqlsh(thrift 接口)的端口不同。例如,您可以检查本机接口的端口,即使用驱动程序的端口 (9042) 是否可访问。
  • 在您的cassandra.yaml 中,您的listen_address 设置为什么?

标签: cassandra


【解决方案1】:

我找到了解决这个问题的方法,我不得不将“listen_address”和“rpc_address”更改为机器的 IP 而不是 localhost,然后它就可以工作了,谢谢大家。

【讨论】:

  • 这无疑是“我无法连接到我的 Cassandra 集群”问题的最常见解决方案。
  • @user3582861 你可能想“接受”你自己的答案,所以这个问题将显示为已解决(为了以后的读者)
  • 如果您希望能够共享cassandra.yaml 文件,那么您应该将这两个字段留空,并且只需将cqlsh 与您节点的IP 地址一起使用,即cqlsh 1.2.3.4。跨度>
猜你喜欢
  • 1970-01-01
  • 2021-11-14
  • 2023-03-14
  • 2017-01-30
  • 2014-02-22
  • 2013-10-19
  • 2013-10-24
  • 2013-06-24
  • 2021-11-23
相关资源
最近更新 更多