FRPC运行状态在服务器离线时改为未运行
时序数据库入库测试 网卡名称同步修改
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
//package com.tongran.rocketmq.config;
|
||||
//
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.apache.iotdb.session.pool.SessionPool;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//
|
||||
//@Configuration
|
||||
//@Slf4j
|
||||
//public class SessionPoolConfig {
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * IoTDB连接配置
|
||||
// */
|
||||
// @Value("${iotdb.host:172.16.15.51}")
|
||||
// private String host;
|
||||
//
|
||||
// @Value("${iotdb.port:6667}")
|
||||
// private Integer port;
|
||||
//
|
||||
// @Value("${iotdb.username:root}")
|
||||
// private String username;
|
||||
//
|
||||
// @Value("${iotdb.password:root123}")
|
||||
// private String password;
|
||||
//
|
||||
// @Value("${iotdb.pool.maxSize:10}")
|
||||
// private int maxSize;
|
||||
//
|
||||
// @Value("${iotdb.pool.enableCompression:false}")
|
||||
// private boolean enableCompression;
|
||||
//
|
||||
// /**
|
||||
// * 创建IoTDB SessionPool连接池
|
||||
// */
|
||||
// @Bean(destroyMethod = "close")
|
||||
// public SessionPool sessionPool() {
|
||||
// try {
|
||||
// log.info("开始初始化IoTDB SessionPool连接池...");
|
||||
// log.info("IoTDB连接参数 - Host: {}, Port: {}, Username: {}, PoolSize: {}",
|
||||
// host, port, username, maxSize);
|
||||
//
|
||||
// // 构建SessionPool
|
||||
// SessionPool sessionPool = new SessionPool.Builder()
|
||||
// .host(host)
|
||||
// .port(port)
|
||||
// .user(username)
|
||||
// .password(password)
|
||||
// .maxSize(maxSize)
|
||||
// .enableCompression(enableCompression)
|
||||
// .build();
|
||||
//
|
||||
// // 测试连接
|
||||
// if (testConnection(sessionPool)) {
|
||||
// log.info("IoTDB SessionPool连接池初始化成功!");
|
||||
// return sessionPool;
|
||||
// } else {
|
||||
// log.error("IoTDB连接测试失败,请检查配置和IoTDB服务状态");
|
||||
// throw new RuntimeException("IoTDB连接测试失败");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("初始化IoTDB SessionPool失败: ", e);
|
||||
// throw new RuntimeException("初始化IoTDB SessionPool失败", e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 测试IoTDB连接
|
||||
// */
|
||||
// private boolean testConnection(SessionPool sessionPool) {
|
||||
// try {
|
||||
// // 执行一个简单的查询来测试连接
|
||||
// String testSql = "show version";
|
||||
// sessionPool.executeQueryStatement(testSql);
|
||||
// log.info("IoTDB连接测试成功");
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// log.error("IoTDB连接测试异常: ", e);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
Reference in New Issue
Block a user