请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

clickhouse failed to respond

老师好~我这边按照视频里导入的ru.yandex.clickhouse:clickhouse-jdbc:0.1.54 (其实maven不知道为啥倒不进来,还是我手动下载jar添加进来的。。),然后运行代码就报这个错误。VM上的8123测试是开通的。

搜了网上说是个常见的错误,我也尝试过更新依赖到0.2.4,修改clickhouse-server/config.xml的keep-alive-timeout参数到30,但都没有效果。。实在搜不到解决方案了,想请老师看看这个该怎么破。。


Exception in thread "main" java.lang.RuntimeException: ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, code: 1002, host: flink010, port: 8123; flink010:8123 failed to respond
	at ru.yandex.clickhouse.ClickHouseConnectionImpl.initTimeZone(ClickHouseConnectionImpl.java:97)
	at ru.yandex.clickhouse.ClickHouseConnectionImpl.<init>(ClickHouseConnectionImpl.java:78)
	at ru.yandex.clickhouse.ClickHouseDriver.connect(ClickHouseDriver.java:55)
	at ru.yandex.clickhouse.ClickHouseDriver.connect(ClickHouseDriver.java:47)
	at ru.yandex.clickhouse.ClickHouseDriver.connect(ClickHouseDriver.java:29)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:270)
	at com.imooc.clickhouse.ClickhouseJDBCApp.main(ClickhouseJDBCApp.java:10)
Caused by: ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, code: 1002, host: flink010, port: 8123; flink010:8123 failed to respond
	at ru.yandex.clickhouse.except.ClickHouseExceptionSpecifier.getException(ClickHouseExceptionSpecifier.java:88)
	at ru.yandex.clickhouse.except.ClickHouseExceptionSpecifier.specify(ClickHouseExceptionSpecifier.java:55)
	at ru.yandex.clickhouse.except.ClickHouseExceptionSpecifier.specify(ClickHouseExceptionSpecifier.java:24)
	at ru.yandex.clickhouse.ClickHouseStatementImpl.getInputStream(ClickHouseStatementImpl.java:628)
	at ru.yandex.clickhouse.ClickHouseStatementImpl.executeQuery(ClickHouseStatementImpl.java:114)
	at ru.yandex.clickhouse.ClickHouseStatementImpl.executeQuery(ClickHouseStatementImpl.java:97)
	at ru.yandex.clickhouse.ClickHouseStatementImpl.executeQuery(ClickHouseStatementImpl.java:92)
	at ru.yandex.clickhouse.ClickHouseStatementImpl.executeQuery(ClickHouseStatementImpl.java:87)
	at ru.yandex.clickhouse.ClickHouseConnectionImpl.initTimeZone(ClickHouseConnectionImpl.java:92)
	... 7 more
Caused by: org.apache.http.NoHttpResponseException: flink010:8123 failed to respond
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
	at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)
	at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
	at ru.yandex.clickhouse.ClickHouseStatementImpl.getInputStream(ClickHouseStatementImpl.java:609)
	... 12 more

麻烦老师了~

正在回答 回答被采纳积分+3

1回答

Michael_PK 2022-07-25 00:02:30

Caused by: ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, code: 1002, host: flink010, port: 8123; flink010:8123 failed to respond


这个错,说明,你代码运行的地方连不到这几个服务器中


0 回复 有任何疑惑可以回复我~
  • 提问者 慕少7351152 #1
    嗯嗯发现问题了,在VM上curl用域名不通,搜了下是listen_host没放开。
    https://www.modb.pro/db/365537
    
    谢谢老师~
    回复 有任何疑惑可以回复我~ 2022-07-25 18:23:40
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信