我们在Digital Ocean上建立了一个3节点的Cassandra集群,并编写了一些Java程序,该程序使用Java CQL驱动程序连接到cassandra。查询将继续运行一段时间,但是一段时间后,我们将收到以下异常
Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /128.199.98.201:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/128.199.98.201] Operation timed out)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:231) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:77) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1402) at com.datastax.driver.core.Cluster.init(Cluster.java:164) at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:343) at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:316) at com.datastax.driver.core.Cluster.connect(Cluster.java:254) at com.attinad.cantiz.iot.platform.cassandrasample.PagingExample.connect(PagingExample.java:24) at com.attinad.cantiz.iot.platform.cassandrasample.App.main(App.java:31)
cassandra.yaml中的各种超时值如下所示
range_request_timeout_in_ms:10000
write_request_timeout_in_ms:2000
counter_write_request_timeout_in_ms:5000
cas_contention_timeout_in_ms:1000
truncate_request_timeout_in_ms:60000
request_timeout_in_ms:10000
任何有关问题是超时问题还是编码问题的想法,我们将不胜感激。