com.datastax.driver.core.exceptions.NoHostAvailableException:尝试查询的所有主机都失败

时间:2015-12-02 22:00:03

标签: java spring-mvc networking network-programming cassandra-2.0

尝试连接到cassandra集群并显示表内容时,我面临以下问题:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /175.14.3.164:9042 (com.datastax.driver.core.TransportException: [/172.16.3.163:9042] Cannot connect))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1272)
at com.datastax.driver.core.Cluster.init(Cluster.java:158)
at com.datastax.driver.core.Cluster.connect(Cluster.java:248)
at com.datastax.driver.core.Cluster.connect(Cluster.java:281)
at com.X.Y.App.main(App.java:27)

在我的cassandra.yaml文件中

native_transport_port: 9042
My listen_address : 172.14.3.164
seeds: 172.14.3.164
rpc_address: 172.14.3.164

代码:

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

我见过与之相关的其他链接,但是跟着他们但仍然无法修复它。请帮助

0 个答案:

没有答案