I have a deployed Cassandra DB that I've been trying to connect to but I get the below error message:
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: <ipaddress_here>:<port_here> (com.datastax.driver.core.exceptions.TransportException: [<ipaddress_here>:<port_here> ] Cannot connect))
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:232)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79)
at com.datastax.driver.core.Cluster$Manager.negotiateProtocolVersionAndConnect(Cluster.java:1631)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1549)
at com.datastax.driver.core.Cluster.init(Cluster.java:160)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:342)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:317)
at com.datastax.driver.core.Cluster.connect(Cluster.java:259)
at org.springframework.cassandra.config.CassandraCqlClusterFactoryBean.executeSpecsAndScripts(CassandraCqlClusterFactoryBean.java:327)
at org.springframework.cassandra.config.CassandraCqlClusterFactoryBean.afterPropertiesSet(CassandraCqlClusterFactoryBean.java:243)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)
The <ipaddress_here>:<port_here>
snippet in the error is actually my valid ip and port that I'm expecting but was removed for obvious reasons. I've had Cassandra working on my local and the permissions on the remote Cassandra are correct since a colleague can successfully connect to the keyspace.
I've seen extending the timeout and this post about the native connections but don't know what else to try.
My Cassandra config is setup similar to this.
The port I am using is different from the default 9042 and 9160 that I've seen on the boards elsewhere. I also used 9042 when I connected on my localhost.
Any help is appreciated including how to get better error logs!
Is there a proxy I would have to set if I'm behind one?