com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed), /x.x.x.3:9042 (com.datastax.driver.core.TransportException: [/x.x.x.3:9042] Connection has been closed), /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed))

DataStax JIRA | chenwu | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I test tps. But running for a while, throw exception beblow: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed), /x.x.x.3:9042 (com.datastax.driver.core.TransportException: [/x.x.x.3:9042] Connection has been closed), /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed))        at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84)        at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:289)        at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:205)        at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)        at com.duowan.test.cassandra.TPSTest$2.run(TPSTest.java:107)        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)        at java.util.concurrent.FutureTask.run(FutureTask.java:262)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)        at java.lang.Thread.run(Thread.java:745) my code: {code:java} PoolingOptions poolingOptions = new PoolingOptions();   poolingOptions.setMaxSimultaneousRequestsPerHostThreshold(HostDistance.LOCAL, 1024).setMaxSimultaneousRequestsPerHostThreshold(HostDistance.REMOTE, 256);   poolingOptions.setPoolTimeoutMillis(60000);   ReconnectionPolicy reconnectionPolicy = new ExponentialReconnectionPolicy(1000,10000);   SocketOptions socketOptions = new SocketOptions();   socketOptions.setReadTimeoutMillis(30000);   cluster = Cluster.builder().addContactPoint(node)     .withPoolingOptions(poolingOptions)     .withReconnectionPolicy(reconnectionPolicy)     .withSocketOptions(socketOptions)     .withProtocolVersion(ProtocolVersion.V3)     .withRetryPolicy(DowngradingConsistencyRetryPolicy.INSTANCE)     .build();   session = cluster.connect(); {code}

    DataStax JIRA | 2 years ago | chenwu
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed), /x.x.x.3:9042 (com.datastax.driver.core.TransportException: [/x.x.x.3:9042] Connection has been closed), /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed))
  2. 0

    Spring Data CassandraTemplate insert throws exception but writes anyway

    Stack Overflow | 2 years ago | BPS
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)
  3. 0

    Need help getting spark-cassandra-connector to work

    Stack Overflow | 3 years ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [CASSANDRA-8390] The process cannot access the file because it is being used by another process - ASF JIRA

    apache.org | 1 year ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)

    5 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.datastax.driver.core.exceptions.NoHostAvailableException

      All host(s) tried for query failed (tried: /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed), /x.x.x.3:9042 (com.datastax.driver.core.TransportException: [/x.x.x.3:9042] Connection has been closed), /x.x.x.1:9042 (com.datastax.driver.core.TransportException: [/x.x.x.2:9042] Connection has been closed))

      at com.datastax.driver.core.exceptions.NoHostAvailableException.copy()
    2. DataStax Java Driver for Apache Cassandra - Core
      AbstractSession.execute
      1. com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84)
      2. com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:289)
      3. com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:205)
      4. com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
      4 frames
    3. com.duowan.test
      TPSTest$2.run
      1. com.duowan.test.cassandra.TPSTest$2.run(TPSTest.java:107)
      1 frame
    4. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:262)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames