连接到远程Cassandra docker容器时,DBeaver中的NoHostAvailableException

时间:2016-11-10 14:37:57

标签: docker cassandra dbeaver

我在英特尔NUC上的Docker容器中运行了一个Cassandra实例。从我的mac,我可以ssh到这个并连接到cqlsh罚款。但是,当我尝试使用DBeaver Enterprise进行连接时,我得到:

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))

启用和不启用SSL时都会发生这种情况。我也成功配置了SSH隧道,但我也试过这个禁用。

在我的NUC上,我似乎有三个以太网接口;通常的enp0s25以及docker0br-65e6f96b0e4f。我已尝试使用这两个接口的相关IP地址似乎做得更多,因为它们会暂停几秒钟,但最终会抛出相同的异常。

版本:

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

查看调试日志,我看到以下消息(使用公钥auth启用SSH隧道):

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

0 个答案:

没有答案