From e0f7f3cc435591fe98e57bd9cdf9f96cf94285c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=B7=E6=88=90=E4=BC=9F?= Date: Fri, 27 Dec 2024 11:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=97=A5=E5=BF=97=E5=88=B0lo?= =?UTF-8?q?g4j2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- das/pom.xml | 10 +++++++++- .../com/das/modules/data/service/TDEngineService.java | 8 ++++---- .../node/service/impl/NodeMessageServiceImpl.java | 5 ++++- das/src/main/resources/application-dev.yml | 11 +++++++++-- das/src/main/resources/application.yml | 2 ++ 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/das/pom.xml b/das/pom.xml index df873674..aea4ba76 100644 --- a/das/pom.xml +++ b/das/pom.xml @@ -44,9 +44,17 @@ spring-boot-starter-tomcat org.springframework.boot + + org.springframework.boot + spring-boot-starter-logging + - + + + org.springframework.boot + spring-boot-starter-log4j2 + org.springframework.boot diff --git a/das/src/main/java/com/das/modules/data/service/TDEngineService.java b/das/src/main/java/com/das/modules/data/service/TDEngineService.java index b8c09675..1e99ff2d 100644 --- a/das/src/main/java/com/das/modules/data/service/TDEngineService.java +++ b/das/src/main/java/com/das/modules/data/service/TDEngineService.java @@ -58,8 +58,8 @@ public class TDEngineService { config.setUsername(username); config.setPassword(password); config.setConnectionTestQuery("select server_status()"); - config.setMinimumIdle(10); //minimum number of idle connection - config.setMaximumPoolSize(20); //maximum number of connection in the pool + config.setMinimumIdle(30); //minimum number of idle connection + config.setMaximumPoolSize(30); //maximum number of connection in the pool config.setMaxLifetime(0); // maximum life time for each connection // config.setIdleTimeout(0); // max idle time for recycle idle connection log.info("=======>TDEngineUrl:" + config.getJdbcUrl()); @@ -89,7 +89,7 @@ public class TDEngineService { } sb.append(") TAGS (`deviceid` BIGINT);"); try { - log.info(sb.toString()); + log.debug(sb.toString()); pstmt.executeUpdate(sb.toString()); } catch (Exception e) { log.error("创建超级表失败", e); @@ -111,7 +111,7 @@ public class TDEngineService { sb.append(dataType); sb.append(") TAGS (`deviceid` BIGINT);"); try { - log.info(sb.toString()); + log.debug(sb.toString()); pstmt.executeUpdate(sb.toString()); } catch (Exception e) { log.error("创建[计算量]超级表失败", e); diff --git a/das/src/main/java/com/das/modules/node/service/impl/NodeMessageServiceImpl.java b/das/src/main/java/com/das/modules/node/service/impl/NodeMessageServiceImpl.java index f8c5e684..285e7b52 100644 --- a/das/src/main/java/com/das/modules/node/service/impl/NodeMessageServiceImpl.java +++ b/das/src/main/java/com/das/modules/node/service/impl/NodeMessageServiceImpl.java @@ -94,7 +94,10 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node @PostConstruct public void init() { //初始化高性能队列 - int cpu = Runtime.getRuntime().availableProcessors(); + int cpu = Runtime.getRuntime().availableProcessors() / 2; + if (cpu < 2) { + cpu = 2; + } int bufferSize = 1024 * 4; disruptor = new Disruptor<>(TerminalMessage::new, bufferSize, DaemonThreadFactory.INSTANCE, ProducerType.MULTI, new BlockingWaitStrategy()); // diff --git a/das/src/main/resources/application-dev.yml b/das/src/main/resources/application-dev.yml index 62cbd474..bb481740 100644 --- a/das/src/main/resources/application-dev.yml +++ b/das/src/main/resources/application-dev.yml @@ -96,11 +96,18 @@ calc: task-name: logging: + file: + name: /das/logs/das.log level: com: - das: DEBUG + das: INFO tdengine: password: taosdata url: jdbc:TAOS-RS://192.168.109.187:6041/das - username: root \ No newline at end of file + username: root +minio: + url: http://192.168.109.187:9000 + bucket: das + accessKey: das + secretKey: zaq12WSX \ No newline at end of file diff --git a/das/src/main/resources/application.yml b/das/src/main/resources/application.yml index 2d60c655..cdd4455a 100644 --- a/das/src/main/resources/application.yml +++ b/das/src/main/resources/application.yml @@ -96,6 +96,8 @@ das: key: b6967ee87b86d85a logging: + file: + name: /das/logs/das.log level: root: ERROR com: