我想知道 com.datastax.cassandra:cassandra-driver-core:2.0.0-beta2 是否可以与 org.apache.cassandra:cassandra-all:1.2.1 一起使用。我正在使用 cassandra-maven-plugin:1.2.1-1 (它使用 org.apache.cassandra:cassandra-all:1.2.1),添加
start_native_transport: true
native_transport_port: ${cassandra.nativePort}
到yaml
插件属性。我可以成功 telnet 到端口。
但是,当我尝试通过以下代码进行连接时,
// Ports.NATIVE has the same value as "${cassandra.nativePort}" above
Cluster cluster = Cluster.builder().addContactPoint("127.0.0.1")
.withPort(Ports.NATIVE).build();
Session session = cluster.connect();
我得到以下异常:
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1 (com.datastax.driver.core.ConnectionException: [/127.0.0.1] Unexpected error during transport initialization (com.datastax.driver.core.TransportException: [/127.0.0.1] Unexpected exception triggered (com.datastax.driver.core.exceptions.DriverInternalError: Server response from unsupported protocol version: 1))))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:179)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:868)
at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:888)
at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:792)
at com.datastax.driver.core.Cluster.connect(Cluster.java:155)
我认为它的症结在于Server response from unsupported protocol version: 1
。
这是否意味着 2.0.0-beta2 驱动程序不能与 Cassandra 1.2.1 一起使用?驱动程序/服务器兼容性矩阵在哪里?
我已经为此烧了将近一天。
谢谢,马修