我正在做一个项目,使用Windows中的JDBC连接到运行在Linux上的TDengine数据库。
配置设置如下:
spring.datasource.driver-class-name=com.taosdata.jdbc.TSDBDriver
spring.datasource.url=jdbc:TAOS://192.168.2.58:6030/test?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8
spring.datasource.username=root
spring.datasource.password=taosdata我还调查了TDengine的日志。
06/29 18:29:30.630000 00018224 TSC starting to initialize TAOS client ...
06/29 18:29:30.630000 00018224 TSC Local End Point is:DESKTOP-PEO5CFV:6030
06/29 18:29:30.630000 00018224 UTL tsc scheduler is initialized, numOfThreads:6
06/29 18:29:30.630000 00018224 TMR ttimer monotonic clock source:POSIX clock_gettime
06/29 18:29:30.630000 00018224 UTL tmr scheduler is initialized, numOfThreads:1
06/29 18:29:30.631000 00018224 TSC TableMeta:0000016FE156BF40
06/29 18:29:30.631000 00018224 TSC client is initialized successfully
06/29 18:29:30.631000 00018224 UTL pool:0000016FE16D1CB0 is setup, maxId:5000
06/29 18:29:30.631000 00018224 TMR ttimer monotonic clock source:POSIX clock_gettime
06/29 18:29:30.631000 00018224 UTL open udp socket:0x0:0
06/29 18:29:30.631000 00018224 UTL open udp socket:0x0:0
06/29 18:29:30.631000 00018224 UTL open udp socket:0x0:0
06/29 18:29:30.631000 00018224 UTL open udp socket:0x0:0
06/29 18:29:30.631000 00016360 RPC TSC UDP thread is created, index:1
06/29 18:29:30.631000 00004944 RPC TSC UDP thread is created, index:0
06/29 18:29:30.631000 00018224 UTL open udp socket:0x0:0
06/29 18:29:30.631000 00016308 RPC TSC UDP thread is created, index:2
06/29 18:29:30.631000 00018224 UTL open udp socket:0x0:0
06/29 18:29:30.631000 00011648 RPC TSC UDP thread is created, index:3
06/29 18:29:30.631000 00018224 RPC TSC UDP connection is initialized, ip:0:0 threads:6
06/29 18:29:30.631000 00018224 RPC TSC rpc is opened, threads:6 sessions:5000
06/29 18:29:30.631000 00008320 RPC TSC UDP thread is created, index:4
06/29 18:29:30.631000 00018224 UTL cache:rpcObj, key:00000017E0BFA2A0, 0000016FE14D6C50 added into cache, added:1624962570631, expire:1624962575631, totalNum:1 totalSize:617bytes size:520bytes
06/29 18:29:30.631000 00018224 TSC 0000016FE1A401E0 new SqlObj from 0000016FE19F3950, total in tscObj:1, total:1
06/29 18:29:30.631000 00018224 TSC 0000016FE1A401E0 SQL cmd:connect will be processed, name:, type:0
06/29 18:29:30.631000 00000868 RPC TSC UDP thread is created, index:5
06/29 18:29:30.631000 00018224 RPC TSC 0000016FE3DE81B8 client connection is allocated, uid:0xe3df2b5e
06/29 18:29:30.631000 00018224 RPC TSC UDP connection is setup, ip:6cdf6527:6030 localPort:63914
06/29 18:29:30.631000 00018224 RPC TSC 0000016FE3DE81B8 0000000000000002, connect is sent to 39.101.223.108:6030, len:377 sig:0x01000000:0x00000000:26895
06/29 18:29:31.636000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, expected connect-rsp is not received
06/29 18:29:31.636000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, re-send msg:connect to 39.101.223.108:6030
06/29 18:29:31.636000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, connect is sent to 39.101.223.108:6030, len:377 sig:0x01000000:0x00000000:26895
06/29 18:29:32.641000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, expected connect-rsp is not received
06/29 18:29:32.641000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, re-send msg:connect to 39.101.223.108:6030
06/29 18:29:32.641000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, connect is sent to 39.101.223.108:6030, len:377 sig:0x01000000:0x00000000:26895
06/29 18:29:33.646000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, expected connect-rsp is not received
06/29 18:29:33.646000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, re-send msg:connect to 39.101.223.108:6030
06/29 18:29:33.646000 00019936 RPC TSC 0000016FE3DE81B8 0000000000000002, connect is sent to 39.101.223.108:6030, len:377 sig:0x01000000:0x00000000:26895我不知道发生了什么。有人能给出一个如何解决它的提示吗?
发布于 2021-07-16 17:36:21
此异常通常是由网络配置引起的,客户端时区与服务器客户端不匹配。尝试使用taos客户端与服务器连接。
发布于 2021-09-28 03:37:22
在JDBC连接字符串中,使用主机名而不是IP地址:
jdbc:TAOS://DESKTOP-PEO5CFV:6030/test?timezone=UTC-8&charset=UTF-8&locale=en_US.UTF-8https://stackoverflow.com/questions/68396224
复制相似问题