Browse Source

迁移至1区

xushili 2 years ago
parent
commit
debabf3394

+ 5 - 1
gyee-sample-impala/pom.xml

@@ -53,7 +53,11 @@
             <artifactId>spring-boot-configuration-processor</artifactId>
             <optional>true</optional>
         </dependency>
-
+        <dependency>
+            <groupId>org.postgresql</groupId>
+            <artifactId>postgresql</artifactId>
+            <version>42.4.0</version>
+        </dependency>
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>

+ 2 - 2
gyee-sample-impala/src/main/java/com/gyee/impala/common/feign/RemoteServiceBuilder.java

@@ -38,7 +38,7 @@ public class RemoteServiceBuilder {
                 .retryer(new Retryer.Default(10000, 10000, 3))
                 .target(IShardingService.class, config.getAlertUrl());
     }
-
+/*
     @Bean
     public IHostService hostparam() {
         return Feign.builder()
@@ -47,5 +47,5 @@ public class RemoteServiceBuilder {
                 .options(new Request.Options(5000, 600000))
                 .retryer(new Retryer.Default(10000, 10000, 3))
                 .target(IHostService.class, config.getHostUrl());
-    }
+    }*/
 }

+ 2 - 2
gyee-sample-impala/src/main/java/com/gyee/impala/controller/diagnose/HostparamController.java

@@ -21,8 +21,8 @@ public class HostparamController {
      */
     @GetMapping("/{host}/{port}")
     public JSONObject getHostParam(@PathVariable String  host,@PathVariable int port) {
-        JSONObject  json = hostparamService.exec(host,port);
-        return json;
+        //JSONObject  json = hostparamService.exec(host,port);
+        return new JSONObject();
     }
 
 }

+ 1 - 2
gyee-sample-impala/src/main/java/com/gyee/impala/schdule/TaskStatistic.java

@@ -5,7 +5,6 @@ import com.gyee.impala.model.master.Casefaultalg;
 import com.gyee.impala.service.master.CasefaultalgService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
@@ -24,7 +23,7 @@ public class TaskStatistic {
     /**
      * 统计算法准确率
      */
-    @Scheduled(initialDelay = 60 * 1000, fixedRate = 1 * 60 * 60 * 1000)
+    //@Scheduled(initialDelay = 60 * 1000, fixedRate = 1 * 60 * 60 * 1000)
     public void accuracyStatisticTask() {
         if (0 == InitialRunner.historyList.size())
             return;

+ 2 - 3
gyee-sample-impala/src/main/java/com/gyee/impala/schdule/TaskWeather.java

@@ -10,7 +10,6 @@ import com.gyee.impala.model.master.Weatherforecast;
 import com.gyee.impala.service.decision.WfNwpDataService;
 import com.gyee.impala.service.master.WeatherforecastService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -43,7 +42,7 @@ public class TaskWeather {
     }
 
 
-    @Scheduled(cron = "0 0 1 * * ?")
+    //@Scheduled(cron = "0 0 1 * * ?")
     public void weatherForecastTask(){
         MAP_STATION.forEach((k, v) -> {
             Weatherforecast forecast = forecastService.getOneMaxTimeByStation(v);
@@ -67,7 +66,7 @@ public class TaskWeather {
     /**
      * 天气样本库加入实际风速
      */
-    @Scheduled(cron = "0 15 1 * * ?")
+    //@Scheduled(cron = "0 15 1 * * ?")
     public void weatherAddActualspeedTask(){
         QueryWrapper<Weatherforecast> wrapper1 = new QueryWrapper<>();
         wrapper1.between("time",DateUtil.getPreviousDate(26),new Date());

+ 2 - 3
gyee-sample-impala/src/main/java/com/gyee/impala/schdule/TaskWindspeedForecast.java

@@ -11,7 +11,6 @@ import com.gyee.impala.service.master.IWindspeedforecastshorttermService;
 import com.gyee.impala.service.master.IWindspeedforecastspshorttermService;
 import lombok.SneakyThrows;
 import org.apache.kudu.client.KuduException;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.Resource;
@@ -108,7 +107,7 @@ public class TaskWindspeedForecast {
     }
     
     @SneakyThrows
-    @Scheduled(cron = "0 25 2 * * ?")
+    //@Scheduled(cron = "0 25 2 * * ?")
     //短期
     public void shortTerm() {
         Calendar today = Calendar.getInstance();
@@ -344,7 +343,7 @@ public class TaskWindspeedForecast {
     }
 
     @SneakyThrows
-    @Scheduled(cron = "0 45 2 * * ?")
+    //@Scheduled(cron = "0 45 2 * * ?")
     //超短期
     public void specialShortTerm() {
 

+ 2 - 2
gyee-sample-impala/src/main/java/com/gyee/impala/service/custom/diagnose/HostparamService.java

@@ -24,9 +24,9 @@ public class HostparamService {
             url.append("http://").append(host).append(":").append(port);
             config.setHostUrl(url.toString());
         }
-        JSONObject json = remoteService.hostparam().getParam();
+        //JSONObject json = remoteService.hostparam().getParam();
 
-        return json;
+        return new JSONObject();
     }
 
 

+ 11 - 31
gyee-sample-impala/src/main/resources/application.yaml

@@ -1,17 +1,15 @@
 gyee:
   # golden实时适配器的url
-  golden-url: http://10.155.32.4:8011
+  golden-url: http://18.6.30.71:8011
   # 报警url
-  alert-url: http://192.168.1.14:8075
-  #alert-url: http://localhost:8075
-  host-url: http://10.155.32.14:8520
+  alert-url: http://18.6.30.71:8075
   # 样本数据统计开始时间
   init-time: 2022-01-01 00:00:00
   # 故障样本数据导入模板路径
   template-path-window: D://java//kudu//template/
   template-path-linux: /home/gyee/fault_digonsis/services/template/
   # kudu的host
-  kudu-host: 192.168.1.60
+  kudu-host: 18.6.30.73
   # 故障诊断脚本路径
   diagnose-path-window: D://test//
   diagnose-path-linux: /home/gyee/fault_digonsis/scripts/
@@ -45,25 +43,13 @@ spring:
       #kudu数据库
       master:
         driver-class-name: com.cloudera.impala.jdbc41.Driver
-        jdbc-url: jdbc:impala://192.168.1.62:21050/gyee_sample_kudu
-      #三区oracle数据库
+        jdbc-url: jdbc:impala://18.6.30.73:21050/gyee_sample_kudu
+      #一区postgresql数据库
       slave:
-        jdbc-url: jdbc:oracle:thin:@192.168.1.105:1521:gdnxfd
-        username: nxfdprod
+        jdbc-url: jdbc:postgresql://18.6.30.71:5432/wisdom_cs
+        username: postgres
         password: gdnxfd123
-        driver-class-name: oracle.jdbc.OracleDriver
-      #网源oracle数据库 -- 数据采集
-      decision:
-        jdbc-url: jdbc:oracle:thin:@10.155.32.7:1521:ORCL
-        username: gyee
-        password: FRWIND
-        driver-class-name: oracle.jdbc.OracleDriver
-      #国电oracle数据库 -- oa
-      gdoa:
-        jdbc-url: jdbc:oracle:thin:@192.168.1.10:1521:ORCL
-        username: mis
-        password: GDnxXNY_2020#!
-        driver-class-name: oracle.jdbc.OracleDriver
+        driver-class-name: org.postgresql.Driver
       # 初始化大小,最小,最大
       initial-size: 1
       min-idle: 1
@@ -85,13 +71,13 @@ spring:
 ####################三区大数据服务器 SFTP  hive 配置####################
 hiveconfig:
   protocols: sftp
-  host: 192.168.1.60
+  host: 18.6.30.73
   port: 22
   username: root
   password: Admin@2019
   path: /home/gyee/kudu/dataprocess/
   driver: org.apache.hive.jdbc.HiveDriver
-  url: jdbc:hive2://192.168.1.60:10000/default
+  url: jdbc:hive2://18.6.30.73:10000/default
 ####################三区大数据服务器 SFTP EXEC 配置####################
 
 
@@ -99,7 +85,6 @@ hiveconfig:
 mybatis-plus:
   configuration:
     map-underscore-to-camel-case: true # 数据库下划线自动转驼峰标示关闭
-    # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 ####################Mybatis Plus配置####################
 
 
@@ -110,9 +95,4 @@ logging:
     root: info
     com.example: debug
   file:
-    path: ./logs
-
-
-## 故障诊断部署  运行  source activate tensorflow-gpu   ##
-## java -jar -Xms512m -Xmx1024m -XX:PermSize=256M -XX:MaxPerSize=512M  /home/gyee/fault_digonsis/services/diagnose-kudu/gyee-sample-impala-0.0.1-SNAPSHOT.jar ##
-
+    path: ./logs