Cassandra客户端无法连接到cassandra服务器

时间:2018-01-02 23:15:32

标签: cassandra kubernetes datastax cassandra-3.0

我正在尝试将cassandra客户端从kubernetes pod连接到cassandra服务器pod。我首先遇到了这个问题:

Exception in thread “main” com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: deep-cas-cassandra.deep/10.98.133.169:9042 (com.datastax.driver.core.exceptions.TransportException: [deep-cas-cassandra.deep/10.98.133.169:9042] Cannot connect))

我通过将客户端版本从2.9.1更改为3.2.0解决了这个问题。 但是现在我从io.netty.util.concurrent.DefaultPromise获得了这个Null指针异常。

这是我现在使用的客户端版本:

<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>3.2.0</version>
</dependency>

这是我的cassandra服务器版本:

root@deep-cas-cassandra-0:/# cqlsh 10.39.0.1
Connected to cassandra at 10.39.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.1 | CQL spec 3.4.4 | Native protocol v4]

这是我在应用程序日志中收到的错误消息:

2018-01-02 20:20:45,957 INFO [main] com.datastax.driver.core.GuavaCompatibility Detected Guava >= 19 in the classpath, using modern compatibility layer
2018-01-02 20:20:46,424 INFO [main] com.datastax.driver.core.ClockFactory Using native clock to generate timestamps.
2018-01-02 20:20:46,701 INFO [main] com.datastax.driver.core.NettyUtil Found Netty's native epoll transport in the classpath, using it
2018-01-02 20:20:47,012 WARN [globalEventExecutor-6-1] io.netty.util.concurrent.DefaultPromise An exception was thrown by com.datastax.driver.core.Connection$1.operationComplete()
java.lang.NullPointerException
at io.netty.channel.group.DefaultChannelGroup.add(DefaultChannelGroup.java:146)
at io.netty.channel.group.DefaultChannelGroup.add(DefaultChannelGroup.java:42)
at com.datastax.driver.core.Connection$1.operationComplete(Connection.java:161)
at com.datastax.driver.core.Connection$1.operationComplete(Connection.java:148)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:481)
at io.netty.util.concurrent.DefaultPromise.access$000(DefaultPromise.java:34)
at io.netty.util.concurrent.DefaultPromise$1.run(DefaultPromise.java:431)
at io.netty.util.concurrent.GlobalEventExecutor$TaskRunner.run(GlobalEventExecutor.java:240)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)

有什么建议吗?任何帮助将不胜感激。

0 个答案:

没有答案