浏览代码

chore: 部署全新 TDengine 3.3.6.0 实例(端口 6031),升级 JDBC 驱动至 3.3.2

- 服务器新建独立 TDengine 容器实例(Podman),端口 6031
- 数据卷挂载至 /mnt/tdengine-new/(大容量数据盘)
- 部署 taos-explorer Web 控制台,nginx 6060 端口反向代理 + Basic Auth
- 升级 taos-jdbcdriver 3.2.7 → 3.3.2
- 应用 JDBC URL 指向新实例 localhost:6031
- TdEngineService 删除 device_id VARCHAR(32) 特殊处理,统一 VARCHAR(255)
mqy20260511
humanleft 2 周前
父节点
当前提交
bb26329b48

+ 1
- 1
iot-platform/pom.xml 查看文件

@@ -74,7 +74,7 @@
74 74
         <dependency>
75 75
             <groupId>com.taosdata.jdbc</groupId>
76 76
             <artifactId>taos-jdbcdriver</artifactId>
77
-            <version>3.2.7</version>
77
+            <version>3.3.2</version>
78 78
         </dependency>
79 79
 
80 80
         <!-- HikariCP (TdEngine 连接池) -->

+ 1
- 1
iot-platform/src/main/java/com/iot/platform/config/IotProperties.java 查看文件

@@ -115,7 +115,7 @@ public class IotProperties {
115 115
      * TDengine配置
116 116
      */
117 117
     public static class TDengine {
118
-        private String url = "jdbc:TAOS://localhost:6030/";
118
+        private String url = "jdbc:TAOS://localhost:6031/";
119 119
         private String username = "";
120 120
         private String password = "";
121 121
 

+ 3
- 2
iot-platform/src/main/java/com/iot/platform/service/TdEngineService.java 查看文件

@@ -533,7 +533,9 @@ public class TdEngineService {
533 533
     /**
534 534
      * 确保表存在
535 535
      */
536
-    private void ensureTableExists(String dbName, String superTableName, String table) throws SQLException {
536
+    private void ensureTableExists(String dbName, String superTableName, String table)
537
+            throws SQLException {
538
+
537 539
         if (!isValidTableName(dbName) || !isValidTableName(superTableName) || !isValidTableName(table)) {
538 540
             throw new IllegalArgumentException("Invalid database or table name: dbName=" + dbName
539 541
                     + ", superTableName=" + superTableName + ", table=" + table);
@@ -599,5 +601,4 @@ public class TdEngineService {
599 601
             dataSource.close();
600 602
         }
601 603
     }
602
-
603 604
 }

+ 1
- 1
iot-platform/src/main/resources/application.yml 查看文件

@@ -70,6 +70,6 @@ iot:
70 70
     password: ${MQTT_PASSWORD:}
71 71
     charge-station-topic: ${MQTT_CHARGE_STATION_TOPIC:station/ChargeStation/device/+/post/json}
72 72
   tdengine:
73
-    url: jdbc:TAOS://localhost:6030/
73
+    url: jdbc:TAOS://localhost:6031/
74 74
     username: ${TDENGINE_USERNAME:}
75 75
     password: ${TDENGINE_PASSWORD:}

+ 2
- 2
iot-platform/src/test/java/com/iot/platform/service/TDengineServiceTest.java 查看文件

@@ -38,7 +38,7 @@ class TDengineServiceTest {
38 38
     @BeforeEach
39 39
     void setUp() {
40 40
         when(iotProperties.getTdengine()).thenReturn(tdengineConfig);
41
-        when(tdengineConfig.getUrl()).thenReturn("jdbc:TAOS://localhost:6030/test");
41
+        when(tdengineConfig.getUrl()).thenReturn("jdbc:TAOS://localhost:6031/test");
42 42
         when(tdengineConfig.getUsername()).thenReturn("root");
43 43
         when(tdengineConfig.getPassword()).thenReturn("taosdata");
44 44
     }
@@ -330,7 +330,7 @@ class TDengineServiceTest {
330 330
     @Test
331 331
     @DisplayName("getConnection: 数据源初始化失败时应抛异常")
332 332
     void getConnection_initFails_throwsException() {
333
-        when(tdengineConfig.getUrl()).thenReturn("jdbc:TAOS://invalid:6030/test");
333
+        when(tdengineConfig.getUrl()).thenReturn("jdbc:TAOS://invalid:6031/test");
334 334
 
335 335
         assertThatThrownBy(() -> tdengineService.getConnection())
336 336
                 .isInstanceOf(Throwable.class);

正在加载...
取消
保存