【发布时间】:2016-09-28 18:30:30
【问题描述】:
(新手问题)我刚刚安装了 cassandra 3.5(在 linux 上,使用通用包)。目前,它是一个完全原版的安装——我没有修改 conf 文件,也没有创建或添加任何东西。
我可以使用 cqlsh 进行连接,但不能使用 javax java 驱动程序(版本 2.0.2)。例如。如果我跑
BasicConfigurator.configure();
集群集群 = Cluster.builder().addContactPoint("127.0.0.1").build(); System.out.println("\n集群名称:" + cluster.getClusterName()+"\n");
会话会话 = cluster.connect();
结果是
0 [main] 调试 com.datastax.driver.core.Cluster - 使用接触点启动新集群 [/127.0.0.1:9042]
集群名称:cluster1
112 [新 I/O 工作人员 #1] 调试 com.datastax.driver.core.Connection - 与 /127.0.0.1:9042 的连接失效 com.datastax.driver.core.TransportException:[/127.0.0.1:9042] 触发了意外异常(java.lang.IndexOutOfBoundsException:没有足够的可读字节 - 需要 4,最大值为 0)
在 com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:601)
在 org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
...
cluster.connect() 抛出异常。
我怀疑我遗漏了什么。任何建议,将不胜感激。谢谢。
【问题讨论】:
标签: cassandra datastax-java-driver