Cassandra datastax java驱动程序,无法连接到服务器“没有为流设置的处理程序”

时间:2013-07-01 08:27:47

标签: cassandra datastax-java-driver

enter image description here

如果我创建这样的新项目。

cluster = Cluster.builder().addContactPoint("127.0.0.1").build();

此代码有效。

但是,如果我从这个项目中取出所有罐子并将罐子迁移到我自己的项目中。上面的代码不起作用,它说:

13/07/01 16:27:16 ERROR core.Connection: [/127.0.0.1-1] No handler set for stream 1 (this is a bug, either of this driver or of Cassandra, you should report it)
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [/127.0.0.1])

1 个答案:

答案 0 :(得分:1)

你在运行什么版本的Cassandra?您是否在cassandra.yaml中启用了本机协议?

在Cassandra 1.2.0-1.2.4中,默认情况下禁用本机协议,但在1.2.5+中默认启用。

请参阅https://github.com/apache/cassandra/blob/cassandra-1.2.5/conf/cassandra.yaml#L335

这是我见过无法连接驱动程序的最常见原因。