alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.97k stars 8.58k forks source link

springboot+druid 访问impala,如何配置自动重连impala #3423

Closed gileth closed 5 years ago

gileth commented 5 years ago

重启impala后,不会自动重连,这个如何配置,没找到相关参数

13567436138 commented 5 years ago

能把你的配置贴出来么

13567436138 commented 5 years ago

testOnborrow testOnReturn 当测试连接失败,应该会终止连接的,然后就是重新获取连接吧

13567436138 commented 5 years ago

有谁有impala的docker镜像,我这里运行试试

gileth commented 5 years ago

就按mysql一样的配置即可,我之前以为kudu不支持,以下配置给有需要的人参考: spring.datasource.druid.impala.driverClassName=com.cloudera.impala.jdbc41.Driver spring.datasource.druid.impala.url=jdbc:impala://127.0.0.1:21050/data_source spring.datasource.druid.impala.username=root spring.datasource.druid.impala.password=sjda1111 spring.datasource.druid.impala.initial-size=20 spring.datasource.druid.impala.max-active=100 spring.datasource.druid.impala.min-idle=5 spring.datasource.druid.impala.max-wait=60000 spring.datasource.druid.impala.pool-prepared-statements=true spring.datasource.druid.impala.max-pool-prepared-statement-per-connection-size=5 spring.datasource.druid.impala.validation-query=select 1 spring.datasource.druid.impala.validation-query-timeout=1 spring.datasource.druid.impala.test-on-borrow=true spring.datasource.druid.impala.test-on-return=true spring.datasource.druid.impala.test-while-idle=true spring.datasource.druid.impala.time-between-eviction-runs-millis=10000 spring.datasource.druid.impala.min-evictable-idle-time-millis=30000 spring.datasource.druid.impala.async-close-connection-enable=true spring.datasource.druid.impala.filter.stat.log-slow-sql=true spring.datasource.druid.impala.filter.stat.slow-sql-millis=10000