Browse Source

配置服务版本升级,修复框架BUG

suxiaoyang 6 years ago
parent
commit
72878b8485

+ 28 - 23
gateway/ag-basic/src/main/resources/application.yml

@ -1,20 +1,5 @@
server:
  port: 10001
zuul:
  config-priority: false
  ignored-services: '*'
  sensitive-headers:
  routes:
    svr-iot:
      path: /iot/**
      serviceId: svr-iot
    svr-base:
      path: /base/**
      serviceId: svr-base
    demo:
      path: /baidu/**
      url: https://www.baidu.com
  port: ${server.ag-basic-port}
spring:
  datasource:
@ -34,7 +19,24 @@ spring:
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
#  sleuth:
#    sampler:
#      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
zuul:
  config-priority: false
  ignored-services: '*'
  sensitive-headers:
  routes:
    svr-iot:
      path: /iot/**
      serviceId: svr-iot
    svr-base:
      path: /base/**
      serviceId: svr-base
    demo:
      path: /baidu/**
      url: https://www.baidu.com
---
spring:
@ -45,10 +47,6 @@ spring:
    password: 123456
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址
#  sleuth:
#    sampler:
#      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
---
spring:
@ -59,6 +57,13 @@ spring:
    password: 123456
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址
#  sleuth:
#    sampler:
#      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
---
spring:
  profiles: jwprod
  datasource:
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
#  zipkin:
#    base-url: http://localhost:9411 #日志追踪的地址

+ 21 - 1
server/svr-zipkin/src/main/resources/application.yml

@ -1,5 +1,5 @@
server:
  port: 9411
  port: ${server.svr-zipkin-port}
---
@ -19,7 +19,27 @@ zipkin:
---
spring:
  profiles: jwtest
#分布式日志存在es里面
zipkin:
  storage:
    type: elasticsearch
    elasticsearch:
      hosts: 172.19.103.68:9300
      cluster:  jkzl
      index: jwlog
      index-shards: 5
      index-replicas: 0
---
spring:
  profiles: jwprod
#分布式日志存在es里面
zipkin:
  storage:
    type: elasticsearch
    elasticsearch:
      hosts: 172.19.103.68:9300
      cluster:  jkzl
      index: jwlog
      index-shards: 5
      index-replicas: 0

+ 9 - 3
server/svr-zipkin/src/main/resources/bootstrap.yml

@ -1,11 +1,9 @@
##优先读取 boostarap配置 然后在读取application。yml的配置
spring:
  application:
    name: svr-zipkin
  #从发现服务里面取配置服务的信息
  cloud:
    config:
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      failFast: true
      username: jw
      password: jkzl
@ -24,3 +22,11 @@ spring:
    config:
      uri: ${wlyy.pring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://172.17.110.212:1221}
      label: ${wlyy.spring.config.label:jwprod}

+ 3 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/activemq/ConsumerRunner.java

@ -1,6 +1,6 @@
package com.yihu.jw.base.activemq;
import com.yihu.utils.context.SpringContext;
import com.yihu.utils.context.SpringContextUtils;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -36,7 +36,7 @@ public class ConsumerRunner implements Runnable, ExceptionListener {
    private void init() {
        try {
            ActiveMQConnectionFactory connectionFactory = SpringContext.getService(ActiveMQConnectionFactory.class);
            ActiveMQConnectionFactory connectionFactory = SpringContextUtils.getService(ActiveMQConnectionFactory.class);
            // Create a Connection
            connection = connectionFactory.createQueueConnection();
            connection.start();
@ -54,7 +54,7 @@ public class ConsumerRunner implements Runnable, ExceptionListener {
    }
    private void recover() throws JMSException {
        ActiveMQConnectionFactory connectionFactory = SpringContext.getService(ActiveMQConnectionFactory.class);
        ActiveMQConnectionFactory connectionFactory = SpringContextUtils.getService(ActiveMQConnectionFactory.class);
        // Create a Connection
        connection = connectionFactory.createQueueConnection();
        connection.start();

+ 48 - 54
svr/svr-base/src/main/resources/application.yml

@ -1,6 +1,6 @@
#通用的配置不用区分环境变量
server:
  #port: ${server.svr-base-port}
  port: 10020
  port: ${server.svr-base-port}
spring:
  datasource:
@ -20,28 +20,15 @@ spring:
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  sleuth:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
  elasticsearch: #ElasticsearchProperties
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes-jest: http://172.19.103.45:9200,http://172.19.103.68:9200  #多个逗号分割
    local: false #是否本地连接
    properties: # Additional properties used to configure the client.
      enable: true
  # JEST (Elasticsearch HTTP client) (JestProperties)
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
#      uris: http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
hibernate:
  dialect: org.hibernate.dialect.MySQL5Dialect
  show_sql: true
#    naming_strategy: org.hibernate.cfg.ImprovedNamingStrategy #springJPA使用驼峰式(hibernate4以下使用)
  physical_naming_strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy #springJPA使用驼峰式(hibernate5以上使用)
  implicit_naming_strategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
---
spring:
@ -50,54 +37,61 @@ spring:
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
  zipkin:
    base-url: http://localhost:9411 #日志追踪的地址
  sleuth:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
  zipkin:
    base-url: http://localhost:9411 #日志追踪的地址
---
spring:
  profiles: jwtest
  datasource:
    url: jdbc:mysql://172.19.103.77/jw2?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  zipkin:
    base-url: http://192.168.131.173:${server.svr-logServer-port} #日志追踪的地址
  sleuth:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
    base-url: http://localhost:9411 #日志追踪的地址
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
---
spring:
  profiles: jwprod
  datasource:
    url: jdbc:mysql://172.19.103.77/jw2?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    url: jdbc:mysql://172.19.103.77/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: root
    password: 123456
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  zipkin:
    base-url: http://192.168.131.173:${server.svr-logServer-port} #日志追踪的地址
  sleuth:
    sampler:
      percentage: 1.0 #采用需要的请求的百分比 默认是0.1 即 10%
es:
  index:
    servicePackLog: base_service_package_log
  type:
    servicePackLog: base_service_package_log
    base-url: http://localhost:9411 #日志追踪的地址

+ 4 - 15
svr/svr-wlyy-specialist/pom.xml

@ -94,39 +94,28 @@
            <artifactId>common-util</artifactId>
        </dependency>
        <!-- jkzl starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>swagger-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>mysql-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.yihu.ehr</groupId>-->
            <!--<artifactId>commons-util</artifactId>-->
            <!--<version>1.1.0</version>-->
        <!--</dependency>-->
        <!-- jkzl starter -->
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>fastdfs-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
        <!--<dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-util</artifactId>
            <version>1.1.0</version>
            <scope>compile</scope>
        </dependency>-->
    </dependencies>
    <build>