Просмотр исходного кода

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 недель назад
Родитель
Сommit
bb26329b48

+ 1
- 1
iot-platform/pom.xml Просмотреть файл

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

+ 1
- 1
iot-platform/src/main/java/com/iot/platform/config/IotProperties.java Просмотреть файл

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

+ 3
- 2
iot-platform/src/main/java/com/iot/platform/service/TdEngineService.java Просмотреть файл

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
         if (!isValidTableName(dbName) || !isValidTableName(superTableName) || !isValidTableName(table)) {
539
         if (!isValidTableName(dbName) || !isValidTableName(superTableName) || !isValidTableName(table)) {
538
             throw new IllegalArgumentException("Invalid database or table name: dbName=" + dbName
540
             throw new IllegalArgumentException("Invalid database or table name: dbName=" + dbName
539
                     + ", superTableName=" + superTableName + ", table=" + table);
541
                     + ", superTableName=" + superTableName + ", table=" + table);
599
             dataSource.close();
601
             dataSource.close();
600
         }
602
         }
601
     }
603
     }
602
-
603
 }
604
 }

+ 1
- 1
iot-platform/src/main/resources/application.yml Просмотреть файл

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

+ 2
- 2
iot-platform/src/test/java/com/iot/platform/service/TDengineServiceTest.java Просмотреть файл

38
     @BeforeEach
38
     @BeforeEach
39
     void setUp() {
39
     void setUp() {
40
         when(iotProperties.getTdengine()).thenReturn(tdengineConfig);
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
         when(tdengineConfig.getUsername()).thenReturn("root");
42
         when(tdengineConfig.getUsername()).thenReturn("root");
43
         when(tdengineConfig.getPassword()).thenReturn("taosdata");
43
         when(tdengineConfig.getPassword()).thenReturn("taosdata");
44
     }
44
     }
330
     @Test
330
     @Test
331
     @DisplayName("getConnection: 数据源初始化失败时应抛异常")
331
     @DisplayName("getConnection: 数据源初始化失败时应抛异常")
332
     void getConnection_initFails_throwsException() {
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
         assertThatThrownBy(() -> tdengineService.getConnection())
335
         assertThatThrownBy(() -> tdengineService.getConnection())
336
                 .isInstanceOf(Throwable.class);
336
                 .isInstanceOf(Throwable.class);

Загрузка…
Отмена
Сохранить