Browse Source

docker打包和容器编排

gaodm 6 years ago
parent
commit
14f1f12620
37 changed files with 967 additions and 57 deletions
  1. 1 1
      admin-service/src/main/resources/bootstrap.yml
  2. 1 1
      bi-service/src/main/resources/bootstrap.yml
  3. 1 0
      common/pom.xml
  4. 0 5
      config-server/pom.xml
  5. 0 2
      config-server/src/main/java/com/diagbot/ConfigServerApplication.java
  6. 33 0
      config-server/src/main/resources/shared/admin-service-local.yml
  7. 49 0
      config-server/src/main/resources/shared/application-dev.yml
  8. 0 0
      config-server/src/main/resources/shared/application-local.yml
  9. 5 5
      config-server/src/main/resources/shared/bi-service-dev.yml
  10. 102 0
      config-server/src/main/resources/shared/bi-service-local.yml
  11. 5 5
      config-server/src/main/resources/shared/diagbotman-service-dev.yml
  12. 102 0
      config-server/src/main/resources/shared/diagbotman-service-local.yml
  13. 5 5
      config-server/src/main/resources/shared/feedback-service-dev.yml
  14. 102 0
      config-server/src/main/resources/shared/feedback-service-local.yml
  15. 54 0
      config-server/src/main/resources/shared/gateway-service-local.yml
  16. 5 5
      config-server/src/main/resources/shared/knowledge-service-dev.yml
  17. 102 0
      config-server/src/main/resources/shared/knowledge-service-local.yml
  18. 5 5
      config-server/src/main/resources/shared/logger-service-dev.yml
  19. 103 0
      config-server/src/main/resources/shared/logger-service-local.yml
  20. 18 0
      config-server/src/main/resources/shared/monitor-service-local.yml
  21. 2 2
      config-server/src/main/resources/shared/uaa-service-dev.yml
  22. 93 0
      config-server/src/main/resources/shared/uaa-service-local.yml
  23. 5 5
      config-server/src/main/resources/shared/user-service-dev.yml
  24. 105 0
      config-server/src/main/resources/shared/user-service-local.yml
  25. 1 1
      diagbotman-service/src/main/resources/bootstrap.yml
  26. 42 8
      docker-compose.yml
  27. 8 0
      eureka-server/src/main/resources/application-dev.yml
  28. 0 0
      eureka-server/src/main/resources/application-local.yml
  29. 10 0
      eureka-server/src/main/resources/bootstrap.yml
  30. 1 1
      feedback-service/src/main/resources/bootstrap.yml
  31. 1 1
      gateway-service/src/main/resources/bootstrap.yml
  32. 1 1
      knowledge-service/src/main/resources/bootstrap.yml
  33. 1 1
      log-service/src/main/resources/bootstrap.yml
  34. 1 1
      monitor-service/src/main/resources/bootstrap.yml
  35. 1 0
      pom.xml
  36. 1 1
      uaa-service/src/main/resources/bootstrap.yml
  37. 1 1
      user-service/src/main/resources/bootstrap.yml

+ 1 - 1
admin-service/src/main/resources/bootstrap.yml

@@ -6,7 +6,7 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local
 
 
 

+ 1 - 1
bi-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local

+ 1 - 0
common/pom.xml

@@ -43,6 +43,7 @@
             <plugin>
                 <groupId>com.spotify</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
+                <version>1.1.1</version>
                 <configuration>
                     <imageName>192.168.2.236:5000/diagbotcloud/${project.artifactId}:${project.version}</imageName>
                     <pushImage>true</pushImage>

+ 0 - 5
config-server/pom.xml

@@ -36,11 +36,6 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-bus-amqp</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-        </dependency>
-
 
 
         <dependency>

+ 0 - 2
config-server/src/main/java/com/diagbot/ConfigServerApplication.java

@@ -3,7 +3,6 @@ package com.diagbot;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.config.server.EnableConfigServer;
-import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 
 /**
  * @Description: 配置中心启动文件
@@ -12,7 +11,6 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
  */
 @SpringBootApplication
 @EnableConfigServer
-@EnableEurekaClient
 public class ConfigServerApplication {
 
     public static void main(String[] args) {

+ 33 - 0
config-server/src/main/resources/shared/admin-service-local.yml

@@ -0,0 +1,33 @@
+server:
+  port: 9998
+
+#spring:
+#  boot:
+#    admin:
+#      routes:
+#        endpoints: env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,loggers,auditevents,hystrix.stream,activiti
+#      turbine:
+#        clusters: default
+#        location: monitor-service
+
+security2:
+    user:
+      name: "admin"
+      password: "123456"
+
+
+spring:
+  profiles: dev
+#  security:
+#    user:
+#      name: ${security2.user.name}
+#      password: ${security2.user.password}
+
+eureka:
+  instance:
+    metadata-map:
+      user.name: ${security2.user.name}
+      user.password: ${security2.user.password}
+
+logging:
+  file: "logs/admin-service-dev.log"

+ 49 - 0
config-server/src/main/resources/shared/application-dev.yml

@@ -0,0 +1,49 @@
+#logging:
+#  level:
+#    org.springframework.security: INFO
+
+#hystrix:
+#  command:
+#    default:
+#      execution:
+#        isolation:
+#          thread:
+#            timeoutInMilliseconds: 10000
+
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health #2.0后actuator的地址发生了变化
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://eureka1:8761/eureka/
+
+#endpoints:
+#  health:
+#    sensitive: false
+#    enabled: true
+#  actuator:
+#    enabled: true
+#    sensitive: false
+#  beans:
+#    sensitive: false
+#    enabled: true
+
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+      cors:
+        allowed-origins: "*"
+        allowed-methods: "*"
+  endpoint:
+      health:
+        show-details: ALWAYS
+feign:
+  hystrix:
+    enabled: true
+
+

config-server/src/main/resources/shared/application.yml → config-server/src/main/resources/shared/application-local.yml


+ 5 - 5
config-server/src/main/resources/shared/bi-service-dev.yml

@@ -19,9 +19,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -60,10 +60,10 @@ spring:
 
   #mq
   rabbitmq:
-    host: localhost
+    host: 192.168.2.236
     port: 5672
-    username: guest
-    password: guest
+    username: lantone
+    password: lantone
     publisher-confirms: true
     virtual-host: /
 

+ 102 - 0
config-server/src/main/resources/shared/bi-service-local.yml

@@ -0,0 +1,102 @@
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+server:
+  port: 8841
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/bi-service-dev.log"

+ 5 - 5
config-server/src/main/resources/shared/diagbotman-service-dev.yml

@@ -19,9 +19,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -60,10 +60,10 @@ spring:
 
   #mq
   rabbitmq:
-    host: localhost
+    host: 192.168.2.236
     port: 5672
-    username: guest
-    password: guest
+    username: lantone
+    password: lantone
     publisher-confirms: true
     virtual-host: /
 

+ 102 - 0
config-server/src/main/resources/shared/diagbotman-service-local.yml

@@ -0,0 +1,102 @@
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+server:
+  port: 8811
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/diagbotman-service-dev.log"

+ 5 - 5
config-server/src/main/resources/shared/feedback-service-dev.yml

@@ -19,9 +19,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -60,10 +60,10 @@ spring:
 
   #mq
   rabbitmq:
-    host: localhost
+    host: 192.168.2.236
     port: 5672
-    username: guest
-    password: guest
+    username: lantone
+    password: lantone
     publisher-confirms: true
     virtual-host: /
 

+ 102 - 0
config-server/src/main/resources/shared/feedback-service-local.yml

@@ -0,0 +1,102 @@
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+server:
+  port: 8831
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/feedback-service-dev.log"

+ 54 - 0
config-server/src/main/resources/shared/gateway-service-local.yml

@@ -0,0 +1,54 @@
+hystrix:
+  command:
+    default:
+      execution:
+        isolation:
+          thread:
+            timeoutInMilliseconds: 20000
+
+ribbon:
+  ReadTimeout: 20000
+  ConnectTimeout: 20000
+
+zuul:
+  host:
+    connect-timeout-millis: 20000
+    socket-timeout-millis: 20000
+
+  routes:
+    user-service:
+      path: /userapi/**
+      serviceId: user-service
+      sensitiveHeaders:
+
+    logger-service:
+      path: /logapi/**
+      serviceId: logger-service
+      sensitiveHeaders:
+
+    bi-service:
+      path: /biapi/**
+      serviceId: bi-service
+      sensitiveHeaders:
+
+    diagbotman-service:
+      path: /diagbotmanapi/**
+      serviceId: diagbotman-service
+      sensitiveHeaders:
+
+    feedback-service:
+      path: /feedbackapi/**
+      serviceId: feedback-service
+      sensitiveHeaders:
+
+    knowledge-service:
+      path: /knowledgeapi/**
+      serviceId: knowledge-service
+      sensitiveHeaders:
+
+server:
+  port: 5050
+
+logging:
+  file: "logs/gateway-service-dev.log"
+

+ 5 - 5
config-server/src/main/resources/shared/knowledge-service-dev.yml

@@ -19,9 +19,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -60,10 +60,10 @@ spring:
 
   #mq
   rabbitmq:
-    host: localhost
+    host: 192.168.2.236
     port: 5672
-    username: guest
-    password: guest
+    username: lantone
+    password: lantone
     publisher-confirms: true
     virtual-host: /
 

+ 102 - 0
config-server/src/main/resources/shared/knowledge-service-local.yml

@@ -0,0 +1,102 @@
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+server:
+  port: 8821
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/knowledge-service-dev.log"

+ 5 - 5
config-server/src/main/resources/shared/logger-service-dev.yml

@@ -20,9 +20,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -61,10 +61,10 @@ spring:
 
   #mq
   rabbitmq:
-    host: localhost
+    host: 192.168.2.236
     port: 5672
-    username: guest
-    password: guest
+    username: lantone
+    password: lantone
     publisher-confirms: true
     virtual-host: /
 

+ 103 - 0
config-server/src/main/resources/shared/logger-service-local.yml

@@ -0,0 +1,103 @@
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+
+server:
+  port: 9997
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-log?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/logger-service-dev.log"

+ 18 - 0
config-server/src/main/resources/shared/monitor-service-local.yml

@@ -0,0 +1,18 @@
+server:
+  port: 8766
+security.basic.enabled: false
+turbine:
+  aggregator:
+    clusterConfig: default
+  appConfig: user-service , logger-service
+  clusterNameExpression: new String("default")
+  combine-host: true
+  instanceUrlSuffix:
+    default: actuator/hystrix.stream
+
+management:
+  security:
+    enabled: false
+
+logging:
+  file: "logs/monitor-service-dev.log"

+ 2 - 2
config-server/src/main/resources/shared/uaa-service-dev.yml

@@ -16,9 +16,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5

+ 93 - 0
config-server/src/main/resources/shared/uaa-service-local.yml

@@ -0,0 +1,93 @@
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/uaa-service-dev.log"
+
+server:
+  port: 9999

+ 5 - 5
config-server/src/main/resources/shared/user-service-dev.yml

@@ -20,9 +20,9 @@ spring:
       driverClassName: com.mysql.jdbc.Driver
       driver-class-name: com.mysql.jdbc.Driver
       platform: mysql
-      url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      url: jdbc:mysql://192.168.2.236:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
       username: root
-      password: root
+      password: lantone
       # 连接池的配置信息
       # 初始化大小,最小,最大
       initialSize: 5
@@ -61,10 +61,10 @@ spring:
 
   #mq
   rabbitmq:
-    host: localhost
+    host: 192.168.2.236
     port: 5672
-    username: guest
-    password: guest
+    username: lantone
+    password: lantone
     publisher-confirms: true
     virtual-host: /
 

+ 105 - 0
config-server/src/main/resources/shared/user-service-local.yml

@@ -0,0 +1,105 @@
+server:
+  port: 8762
+
+
+#spring:
+#  datasource:
+#    driver-class-name: com.mysql.jdbc.Driver
+#    url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+#    username: root
+#    password: root
+#  jpa:
+#    hibernate:
+#      ddl-auto: update
+#    show-sql: true
+
+# 驱动配置信息
+spring:
+  datasource:
+    druid:
+      driverClassName: com.mysql.jdbc.Driver
+      driver-class-name: com.mysql.jdbc.Driver
+      platform: mysql
+      url: jdbc:mysql://localhost:3306/sys-user?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8
+      username: root
+      password: root
+      # 连接池的配置信息
+      # 初始化大小,最小,最大
+      initialSize: 5
+      minIdle: 5
+      maxActive: 20
+      # 配置获取连接等待超时的时间
+      maxWait: 60000
+      # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
+      timeBetweenEvictionRunsMillis: 60000
+      # 配置一个连接在池中最小生存的时间,单位是毫秒
+      minEvictableIdleTimeMillis: 300000
+      validationQuery: SELECT 1 FROM DUAL
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      # 打开PSCache,并且指定每个连接上PSCache的大小
+      poolPreparedStatements: true
+      maxPoolPreparedStatementPerConnectionSize: 20
+      # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
+      filters.commons-log.connection-logger-name: stat,wall,log4j
+      filter.stat.log-slow-sql: true
+      filter.stat.slow-sql-millis: 2000
+#监控配置
+      web-stat-filter:
+        enabled: true
+        url-pattern: /*
+        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
+
+# StatViewServlet配置,说明请参考Druid Wiki,配置_StatViewServlet配置
+      stat-view-servlet:
+        enabled: true
+        url-pattern: /druid/*
+        reset-enable: false
+        login-username: root
+        login-password: root
+
+  #mq
+  rabbitmq:
+    host: localhost
+    port: 5672
+    username: guest
+    password: guest
+    publisher-confirms: true
+    virtual-host: /
+
+#mybatis
+mybatis-plus:
+  mapper-locations: classpath:/mapper/*Mapper.xml
+  #实体扫描,多个package用逗号或者分号分隔
+  typeAliasesPackage: com.diagbot.entity
+  global-config:
+    #刷新mapper 调试神器
+    db-config:
+      #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
+      id-type: id_worker
+      #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
+      field-strategy: not_empty
+      #驼峰下划线转换
+      column-underline: true
+      #数据库大写下划线转换
+      #capital-mode: true
+      #刷新mapper 调试神器
+      refresh-mapper: true
+      #逻辑删除配置
+      logic-delete-value: 0
+      logic-not-delete-value: 1
+      #自定义填充策略接口实现
+      #meta-object-handler: com.baomidou.springboot.xxx
+      #自定义SQL注入器
+      #sql-injector: com.baomidou.springboot.xxx
+  configuration:
+    map-underscore-to-camel-case: true
+    cache-enabled: false
+
+#logging
+logging:
+  level.com.diagbot: debug
+  file: "logs/user-service-dev.log"
+
+foo: foo version 1

+ 1 - 1
diagbotman-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local

+ 42 - 8
docker-compose.yml

@@ -1,41 +1,75 @@
 version: "3"
 services:
   eureka-server:
-    image: diagbotcloud/eureka-server:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/eureka-server:0.0.1-SNAPSHOT
+    hostname: eureka1
     ports:
       - "8761:8761"
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     environment:
       - spring.profiles.active=dev
   config-server:
-    image: diagbotcloud/config-server:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/config-server:0.0.1-SNAPSHOT
+    hostname: config1
+    ports:
+      - "8769:8769"
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     environment:
       - spring.profiles.active=dev
   uaa-service:
-    image: diagbotcloud/uaa-service:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/uaa-service:0.0.1-SNAPSHOT
+    depends_on:
+      - config-server
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     environment:
       - spring.profiles.active=dev
   user-service:
-    image: diagbotcloud/user-service:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/user-service:0.0.1-SNAPSHOT
+    depends_on:
+      - config-server
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     environment:
       - spring.profiles.active=dev
   log-service:
-    image: diagbotcloud/log-service:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/log-service:0.0.1-SNAPSHOT
+    depends_on:
+      - config-server
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     environment:
       - spring.profiles.active=dev
   monitor-service:
-    image: diagbotcloud/monitor-service:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/monitor-service:0.0.1-SNAPSHOT
+    depends_on:
+      - config-server
+      - user-service
+      - log-service
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     ports:
       - "8766:8766"
     environment:
       - spring.profiles.active=dev
   admin-service:
-    image: diagbotcloud/admin-service:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/admin-service:0.0.1-SNAPSHOT
+    depends_on:
+      - config-server
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     ports:
       - "9998:9998"
     environment:
       - spring.profiles.active=dev
   gateway-service:
-    image: diagbotcloud/gateway-service:0.0.1-SNAPSHOT
+    image: 192.168.2.236:5000/diagbotcloud/gateway-service:0.0.1-SNAPSHOT
+    depends_on:
+      - config-server
+#    volumes:
+#      - "data/diagbotcloud/logs:/logs"
     ports:
       - "5050:5050"
     environment:

+ 8 - 0
eureka-server/src/main/resources/application-dev.yml

@@ -0,0 +1,8 @@
+server:
+  port: 8761
+eureka:
+  client:
+    register-with-eureka: false
+    fetch-registry: false
+    serviceUrl:
+      defaultZone: http://eureka1:${server.port}/eureka/

eureka-server/src/main/resources/application.yml → eureka-server/src/main/resources/application-local.yml


+ 10 - 0
eureka-server/src/main/resources/bootstrap.yml

@@ -0,0 +1,10 @@
+spring:
+  profiles:
+    active: local
+
+
+
+
+
+
+

+ 1 - 1
feedback-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local

+ 1 - 1
gateway-service/src/main/resources/bootstrap.yml

@@ -6,7 +6,7 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local
 
 
 

+ 1 - 1
knowledge-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local

+ 1 - 1
log-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local

+ 1 - 1
monitor-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-      active: dev
+      active: local

+ 1 - 0
pom.xml

@@ -125,6 +125,7 @@
             <plugin>
                 <groupId>com.spotify</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
+                <version>1.1.1</version>
                 <configuration>
                     <imageName>${docker.image.prefix}/${project.artifactId}:${project.version}</imageName>
                     <pushImage>true</pushImage>

+ 1 - 1
uaa-service/src/main/resources/bootstrap.yml

@@ -6,7 +6,7 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-      active: dev
+      active: local
 management:
   security:
     enabled: false

+ 1 - 1
user-service/src/main/resources/bootstrap.yml

@@ -6,4 +6,4 @@ spring:
       uri: http://localhost:8769
       fail-fast: true
   profiles:
-    active: dev
+    active: local