一、该问题的重现步骤是什么?
1. 启动项目
2.
3.
二、你期待的结果是什么?实际看到的又是什么?
启动正常
org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [CREATE DATABASE IF NOT EXISTS links PRECISION 'ms' CACHEMODEL 'last_value' KEEP 3650 DURATION 10 BUFFER 16 WAL_LEVEL 1
]; SQL state []; error code [11]; TDengine ERROR (0xb): sql: CREATE DATABASE IF NOT EXISTS links PRECISION 'ms' CACHEMODEL 'last_value' KEEP 3650 DURATION 10 BUFFER 16 WAL_LEVEL 1
, desc: Unable to establish connection
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1549)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:408)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:567)
at org.springblade.iot.tsdb.tdengine.dao.TDEngineTemplate.createDatabase(TDEngineTemplate.java:67)
at org.springblade.iot.tsdb.tdengine.dao.TDEngineTemplate.afterSingletonsInstantiated(TDEngineTemplate.java:444)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:986)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149)
at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:49)
at org.springblade.mqtt.broker.BrokerApplication.main(BrokerApplication.java:43)
Caused by: java.sql.SQLException: TDengine ERROR (0xb): sql: CREATE DATABASE IF NOT EXISTS links PRECISION 'ms' CACHEMODEL 'last_value' KEEP 3650 DURATION 10 BUFFER 16 WAL_LEVEL 1
, desc: Unable to establish connection
at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:95)
at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:97)
at com.taosdata.jdbc.rs.RestfulStatement.execute(RestfulStatement.java:78)
at com.taosdata.jdbc.rs.RestfulStatement.executeUpdate(RestfulStatement.java:56)
at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:555)
at org.springframework.jdbc.core.JdbcTemplate$1UpdateStatementCallback.doInStatement(JdbcTemplate.java:552)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
... 13 common frames omitted
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
bladex-links windows
四、请提供详细的错误堆栈信息,这很重要。
五、若有更多详细信息,请在下面提供。
Unable to establish connection
看着像是tdengine本身的网络问题,你用客户端访问tdengine看看是不是能连接成功。再检查一下tdengne的账号密码和地址的配置是否配置对了, 核心配置如下
tdengine: enabled: true # 是否开启,多个时序库插件依赖同时导入可采用此参数配置,开启的时序库 username: root password: taosdata database: links # 库名,会自动建库 jdbc-url: jdbc:TAOS-RS://127.0.0.1:6041?useSSL=false
另外请给我们邮箱:bladejava@qq.com 发一个邮件提供授权公司名,登记为商业账号后方可进行商业版问题答疑。
扫一扫访问 Blade技术社区 移动端