2016-04-03 12 views
0

使用卡桑德拉3.4節點後,我已經安裝了3.4卡桑德拉on machine 192.168.1.3`並試圖從othet機ACCES我得到在不可達

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.1.3:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.1.3] Cannot connect)) 
    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:1414) 
    at com.datastax.driver.core.Cluster.init(Cluster.java:162) 
    at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:333) 
    at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:308) 
    at com.datastax.driver.core.Cluster.connect(Cluster.java:250) 

這裏是我的連接代碼

cluster = Cluster.builder() 
    .addContactPoints(nodes) 
    .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE) 
    .withReconnectionPolicy(new ConstantReconnectionPolicy(100L)) 
    .build(); 
    session = cluster.connect(); 

我能夠ping通192.168.1.3機器。和cassandra正在運行。在我開始使用cassandra之前它工作的很好3.4.i使用的是datastax cassandra-driver-core3.0.0驅動程序

+0

基本的故障排除步驟包括登錄到該服務器,以確保進程真正運行,檢查服務器日誌是否有錯誤,並嘗試從該服務器進行連接。一旦你完成了所有這三件事情,你就想嘗試從一臺機器telnet到19.2168.1.3:9042 - 如果這樣做,那麼cassandra可用,並且你可能有配置問題。 –

回答

0

使用SocketOption。在這個你必須給時間連接必須相等或更多然後你把Cassandra.conf文件。