Java application(Wasabi) fails when connecting to Cassandra cluster

88 Views Asked by At

I am working on Wasabi - A/B testing tool. I use Cassanra DB(3.11) and Datastax drivers(3.5.0). Application starts fine with single Cassandra node, but fails with multiple ones. Exception is:

77467 [main] ERROR c.i.w.c.d.DefaultCassandraDriver - Exception occurred while connecting to the cluster...
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)

ANSWER:

DefaultCassandraDriver.class has configuration:

builder.withLoadBalancingPolicy( new TokenAwarePolicy( new DCAwareRoundRobinPolicy.Builder() ...

DCAwareRoundRobinPolicy doesn't work and it works with RoundRobinPolicy(it is configurable there). I don't know what is an impact and maybe it is just missing configuration.

I want to point this out for Wasabi and any other Datastax users

1

There are 1 best solutions below

0
On

ANSWER:

DefaultCassandraDriver.class has configuration:

builder.withLoadBalancingPolicy( 
    new TokenAwarePolicy( 
      new DCAwareRoundRobinPolicy.Builder() 
...

DCAwareRoundRobinPolicy doesn't work and it works with RoundRobinPolicy(it is configurable there). I don't know what is an impact and maybe it is just missing configuration.

I want to point this out for Wasabi and any other Datastax users