0

I have a Cassandra instance running in a Docker container on an Intel NUC. From my mac, I can ssh onto this and connect to the cqlsh fine. However, when I try to connect using DBeaver Enterprise I get:

com.datastax.driver.core.exceptions.NoHostAvailableException:
All host(s) tried for query failed (tried: myhostname/xx.xx.xx.xx:9042
(com.datastax.driver.core.exceptions.TransportException:
[myhostname/xx.xx.xx.xx] Cannot connect))

This occurs with and without SSL enabled. I also have an SSH tunnel enabled successfully configured, but I have also tried with this disabled.

On my NUC, I appear to have three ethernet interfaces; the usual enp0s25 and also docker0 and br-65e6f96b0e4f. I have tried the associated IP addresses with these two interfaces which seem to appear to be doing more, as they pause a few seconds, but ultimately throw the same exception.

Versions:

  • Cassandra - 2.2.8
  • CQLSH - 5.0.1
  • DBeaver Enterprise - 3.7.8

Looking in the debug log I see the following messages (SSH tunnel enabled with public key auth):

2016-11-10 15:45:45.616 - Connect with 'cql://xx.xx.xx.xx:9042/mwih_ks' (cql-1582dfdf6b1-3209dg9f13234351a)
2016-11-10 15:45:45.622 - Instantiate SSH tunnel
2016-11-10 15:45:45.623 - Connect to tunnel host
2016-11-10 15:45:45.623 - SSH INFO: Connecting to xx.xx.xx.xx port 22
2016-11-10 15:45:45.632 - SSH INFO: Connection established
...
2016-11-10 15:45:45.759 - SSH INFO: Host 'xx.xx.xx.xx' is known and matches the RSA host key
2016-11-10 15:45:45.760 - SSH INFO: SSH_MSG_NEWKEYS sent
2016-11-10 15:45:45.760 - SSH INFO: SSH_MSG_NEWKEYS received
2016-11-10 15:45:45.761 - SSH INFO: SSH_MSG_SERVICE_REQUEST sent
2016-11-10 15:45:45.761 - SSH INFO: SSH_MSG_SERVICE_ACCEPT received
2016-11-10 15:45:45.763 - SSH INFO: Authentications that can continue: publickey
2016-11-10 15:45:45.763 - SSH INFO: Next authentication method: publickey
2016-11-10 15:45:45.806 - SSH INFO: Authentication succeeded (publickey).
2016-11-10 15:45:45.814 - Connection failed (cql-1582dfdf6b1-3209dg9f13234351a)
2016-11-10 15:53:18.364 - org.jkiss.dbeaver.model.exec.DBCException: All host(s) tried for query failed (tried: /xx.xx.xx.xx:9042 (com.datastax.driver.core.exceptions.TransportException: [/xx.xx.xx.xx] Cannot connect))
org.jkiss.dbeaver.model.exec.DBCException: All host(s) tried for query failed (tried: /192.168.2.2:9042 (com.datastax.driver.core.exceptions.TransportException: [/xx.xx.xx.xx] Cannot connect))
    at com.jkiss.dbeaver.ent.cassandra.model.CasExecutionContext.connect(CasExecutionContext.java:56)
    at com.jkiss.dbeaver.ent.cassandra.model.CasDataSource.<init>(CasDataSource.java:103)
    at com.jkiss.dbeaver.ent.cassandra.CasDataSourceProvider.openDataSource(CasDataSourceProvider.java:65)
    at org.jkiss.dbeaver.registry.DataSourceDescriptor.connect(DataSourceDescriptor.java:644)
    at org.jkiss.dbeaver.runtime.jobs.ConnectJob.run(ConnectJob.java:74)
    at org.jkiss.dbeaver.ui.dialogs.connection.ConnectionWizard$ConnectionTester.run(ConnectionWizard.java:223)
    at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:103)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /xx.xx.xx.xx:9042 (com.datastax.driver.core.exceptions.TransportException: [/xx.xx.xx.xx] 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:1382)
    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.connect(Cluster.java:283)
    at com.jkiss.dbeaver.ent.cassandra.model.CasExecutionContext.reconnect(CasExecutionContext.java:112)
    at com.jkiss.dbeaver.ent.cassandra.model.CasExecutionContext.connect(CasExecutionContext.java:52)
    ... 7 more
MeanwhileInHell
  • 6,780
  • 17
  • 57
  • 106
  • How did you start it in Docker? Did you expose port 9042 to the host? – Andreas Wederbrand Nov 10 '16 at 16:06
  • $ docker run -d -p "7191:7191" -p "7000:7000" -p "7001:7001" -p "9160:9160" -p "9042:9042" -e CASSANDRA_BROADCAST_ADDRESS=xx.xx.xx.xx cassandra:2.2 – MeanwhileInHell Nov 10 '16 at 16:54
  • You should be able to connect to cassandra on the host where docker daemon is running (normally localhost) without using ssh. You only need a tunnel if you have a firewall between you and the server. Don't use the ip internal to docker, use the ip of the host. – Andreas Wederbrand Nov 11 '16 at 06:42
  • Yeah the IP address I'm trying is of the actual NUC that is running the docker deamon. I've tinkered with the ufw, enabling and disabling it, but doesnt get me any further. – MeanwhileInHell Nov 11 '16 at 10:52
  • To eliminate DBeaver try to use telnet against it, if that works then the error is in DBeaver. – Andreas Wederbrand Nov 11 '16 at 15:06

0 Answers0