Browse Source

修改Reids启动异常问题

shilin 2 years ago
parent
commit
7c8c3860a3

+ 91 - 0
cache/src/main/resources/application-hf.yml

@@ -0,0 +1,91 @@
+server:
+  port: 8044
+  servlet:
+    context-path: /
+
+
+spring:
+  main:
+    allow-bean-definition-overriding: true #当遇到同样名字的时候,是否允许覆盖注册
+  #redis集群
+  redis:
+#    host: 49.4.50.80
+    host: 10.0.118.70
+    port: 6379
+    timeout: 100000
+    #    集群环境打开下面注释,单机不需要打开
+    #    cluster:
+    #      集群信息
+    #      nodes: xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx,xxx.xxx.xxx.xxx:xxxx
+    #      #默认值是5 一般当此值设置过大时,容易报:Too many Cluster redirections
+    #      maxRedirects: 3
+    password:
+    application:
+      name: test
+    jedis:
+      pool:
+        max-active: 8
+        min-idle: 0
+        max-idle: 8
+        max-wait: -1
+    database: 0
+  autoconfigure:
+    exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    driver-class-name: oracle.jdbc.OracleDriver
+    #外网
+    url: jdbc:oracle:thin:@10.0.118.71:1521:gdsj
+#    url: jdbc:oracle:thin:@49.4.50.80:1521:gdnxfd
+    #    url: jdbc:oracle:thin:@172.168.1.14:1521:gdnxfd
+    username: gdprod
+    password: gd123
+    oracle-schema=:
+    #    type: com.alibaba.druid.pool.DruidDataSource
+    #    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf8&serverTimezone=UTC
+    #    username: root
+    #    password: root
+    #    driver-class-name: com.mysql.jdbc.Driver
+    druid:
+      max-active: 20
+      initial-size: 1
+      min-idle: 3
+      max-wait: 60000
+      time-between-eviction-runs-millis: 60000
+      min-evictable-idle-time-millis: 300000
+      test-while-idle: true
+      test-on-borrow: false
+      test-on-return: false
+  servlet:
+    multipart:
+      # 开启 multipart 上传功能
+      enabled: true
+      # 文件写入磁盘的阈值
+      file-size-threshold: 2KB
+      # 最大文件大小
+      max-file-size: 200MB
+      # 最大请求大小
+      max-request-size: 215MB
+
+mybatis-plus:
+  configuration:
+    map-underscore-to-camel-case: true
+    auto-mapping-behavior: full
+    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+  mapper-locations: classpath*:mapper/**/*Mapper.xml
+  global-config:
+    # 逻辑删除配置
+    db-config:
+      id-type: auto
+      # 删除前
+      logic-not-delete-value: 1
+      # 删除后
+      logic-delete-value: 0
+logging:
+  level:
+    root: info
+    com.example: debug
+
+
+
+

+ 11 - 4
realtime/generation-service/pom.xml

@@ -12,6 +12,15 @@
     <artifactId>generation-service</artifactId>
 
     <dependencies>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-data-redis</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-pool2</artifactId>
+        </dependency>
+
 
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -41,10 +50,7 @@
             <version>11.2.0.3</version>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.data</groupId>
-            <artifactId>spring-data-redis</artifactId>
-        </dependency>
+
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
@@ -102,6 +108,7 @@
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.7.1</version>
                 <executions>
                     <execution>
                         <goals>

+ 1 - 1
realtime/generation-service/src/main/java/com/gyee/generation/init/CacheContext.java

@@ -93,7 +93,7 @@ public class CacheContext implements CommandLineRunner {
     public void run(String... args) throws Exception {
         logger.info("缓存开始------------------------------------------------------------");
 
-
+        initial();
 
         List<String> runWpids = Arrays.asList(runWindpowerstation.split(","));
         logger.info(runWpids.get(0) + "------------------" + runWpids.size());