diff --git a/Dockerfile-test b/Dockerfile-dev similarity index 63% rename from Dockerfile-test rename to Dockerfile-dev index 4a3ef16..3c897fa 100644 --- a/Dockerfile-test +++ b/Dockerfile-dev @@ -3,8 +3,5 @@ ENV LC_ALL=zh_CN.utf8 ENV LANG=zh_CN.utf8 ENV LANGUAGE=zh_CN.utf8 RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 - -RUN mkdir -p /model -COPY /target/classes/model/. /model/ ADD /target/biz_service_ebtp_extend-0.0.1.jar /biz_service_ebtp_extend-0.0.1.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/skywalking/agent/skywalking-agent.jar", "-Dspring.profiles.active=test", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"] +ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/skywalking/agent/skywalking-agent.jar", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"] diff --git a/Dockerfile-pro b/Dockerfile-master similarity index 56% rename from Dockerfile-pro rename to Dockerfile-master index 13203f6..8d9237c 100644 --- a/Dockerfile-pro +++ b/Dockerfile-master @@ -1,2 +1,2 @@ FROM harbor.dcos.xixian.unicom.local/eshop/jdk8_springboot_agent:v1.6 -ADD target/biz_service_ebtp_extend-0.0.1.jar /app.jar \ No newline at end of file +ADD /target/biz_service_ebtp_extend-0.0.1.jar /app.jar \ No newline at end of file diff --git a/Dockerfile-sim b/Dockerfile-sim new file mode 100644 index 0000000..9b019d2 --- /dev/null +++ b/Dockerfile-sim @@ -0,0 +1,2 @@ +FROM harbor.dcos.guangzhou.unicom.local/eshop/jdk8_springboot_agent:v1.6 +ADD /target/biz_service_ebtp_extend-0.0.1.jar /app.jar \ No newline at end of file diff --git a/Dockerfile-gz b/Dockerfile-uat similarity index 71% rename from Dockerfile-gz rename to Dockerfile-uat index 2b18037..8d548e7 100644 --- a/Dockerfile-gz +++ b/Dockerfile-uat @@ -3,8 +3,5 @@ ENV LC_ALL=zh_CN.utf8 ENV LANG=zh_CN.utf8 ENV LANGUAGE=zh_CN.utf8 RUN localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 - -RUN mkdir -p /model -COPY /target/classes/model/. /model/ ADD /target/biz_service_ebtp_extend-0.0.1.jar /biz_service_ebtp_extend-0.0.1.jar -ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=uat", "-jar", "/biz_service_ebtp_extend-0.0.1.jar"] +ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/skywalking/agent/skywalking-agent.jar","-jar", "/biz_service_ebtp_extend-0.0.1.jar"] diff --git a/config-test b/config-dev similarity index 100% rename from config-test rename to config-dev diff --git a/config-pro b/config-master similarity index 100% rename from config-pro rename to config-master diff --git a/config-gz b/config-sim similarity index 74% rename from config-gz rename to config-sim index 6fe3b43..cfa151b 100644 --- a/config-gz +++ b/config-sim @@ -2,7 +2,7 @@ apiVersion: v1 clusters: - cluster: insecure-skip-tls-verify: true - server: https://10.125.164.35:48662 + server: https://10.172.48.16:44039 name: demok8s contexts: - context: @@ -14,4 +14,4 @@ kind: Config users: - name: cluster-admin user: - token: df5e4896a4f6d1b1447b2584ca7405f7 + token: 2c00232d4e3b1498008315e8ab14283c diff --git a/config-uat b/config-uat new file mode 100644 index 0000000..980e05b --- /dev/null +++ b/config-uat @@ -0,0 +1,17 @@ +apiVersion: v1 +clusters: +- cluster: + insecure-skip-tls-verify: true + server: https://10.125.164.111:42733;https://10.125.164.158:41745;https://10.125.164.8:43001 + name: demok8s +contexts: +- context: + cluster: demok8s + user: cluster-admin + name: default +current-context: default +kind: Config +users: +- name: cluster-admin + user: + token: ae123cd22080c2712d08cb31633a2fa6 \ No newline at end of file diff --git a/deployment-gz.yaml b/deployment-dev.yaml similarity index 57% rename from deployment-gz.yaml rename to deployment-dev.yaml index 4d9e7d4..3c7e0bd 100644 --- a/deployment-gz.yaml +++ b/deployment-dev.yaml @@ -7,23 +7,23 @@ metadata: namespace: default labels: app: biz-service-ebtp-extend - + # 必选,详细定义 spec: # pod 副本数量 replicas: 1 - + # 滚动升级配置信息 strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 - + # 选择器,匹配pod模板 selector: matchLabels: app: biz-service-ebtp-extend - + template: metadata: labels: @@ -32,32 +32,31 @@ spec: annotations: prometheus.io/port: '18018' prometheus.io/jl-pod: 'true' - + # 定义容器模板,该模板可以包含多个容器 spec: - # 挂载日志存储 - volumes: - - name: log - persistentVolumeClaim: - claimName: log-pvc - readOnly: false - # 必选,Pod中容器列表 containers: - - name: biz-service-ebtp-extend - image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest - # 在容器中挂载日志存储区 - volumeMounts: - - name: log - mountPath: /log - # 需要暴露的端口库号列表 - ports: - - containerPort: 18018 - # 容器运行前需设置的环境变量列表 - env: - # Apollo 配置中心变量设置 - - name: APOLLO_CONFIGSERVICE - value: http://10.242.31.158:6001 + - name: biz-service-ebtp-extend + image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest + # 需要暴露的端口库号列表 + ports: + - containerPort: 18018 + # 容器运行前需设置的环境变量列表 + env: + # Apollo 配置中心变量设置 + - name: APOLLO_CONFIGSERVICE + value: http://10.242.37.1488:6001 + - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES + value: skywalking-oap-cluster.skywalking:11800 + - name: SW_AGENT_NAME + value: biz-service-ebtp-extend + - name: APP_NAME + value: biz_service_ebtp_extend_dev + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP --- kind: Service apiVersion: v1 @@ -78,5 +77,5 @@ spec: app: biz-service-ebtp-extend status: loadBalancer: {} - + --- \ No newline at end of file diff --git a/deployment-master.yaml b/deployment-master.yaml new file mode 100644 index 0000000..110aee1 --- /dev/null +++ b/deployment-master.yaml @@ -0,0 +1,118 @@ +# 接口版本 +apiVersion: apps/v1 +# 接口类型 +kind: Deployment +metadata: + name: biz-service-ebtp-extend + namespace: default + labels: + app: biz-service-ebtp-extend + +# 必选,详细定义 +spec: + # pod 副本数量 + replicas: 3 + + # 滚动升级配置信息 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + + # 选择器,匹配pod模板 + selector: + matchLabels: + app: biz-service-ebtp-extend + + template: + metadata: + labels: + # 模板名称 + app: biz-service-ebtp-extend + annotations: + prometheus.io/port: '18018' + prometheus.io/jl-pod: 'true' + + # 定义容器模板,该模板可以包含多个容器 + spec: + volumes: + - name: log + persistentVolumeClaim: + claimName: log-pvc + readOnly: false + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - biz-service-ebtp-extend + topologyKey: "kubernetes.io/hostname" + # 必选,Pod中容器列表 + containers: + - name: biz-service-ebtp-extend + image: harbor.dcos.xixian.unicom.local/eshop/biz-service-ebtp-extend:latest + args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] + volumeMounts: + - name: log + mountPath: /log + ports: + - containerPort: 18018 + #livenessProbe: + # failureThreshold: 3 + # httpGet: + # port: 18018 #[11] pod存活检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 + # path: /actuator/prometheus + # scheme: HTTP + # initialDelaySeconds: 300 + # periodSeconds: 60 + # successThreshold: 1 + # timeoutSeconds: 2 + #readinessProbe: + # failureThreshold: 1 + # httpGet: + # port: 18018 #[12] pod就绪检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 + # path: /actuator/prometheus + # scheme: HTTP + # periodSeconds: 5 + # successThreshold: 2 + # timeoutSeconds: 2 + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 3000m + memory: 6Gi + env: + - name: AGENT_LICENCE + value: 527BFA7B28577578 + - name: APP_NAME + value: biz_service_ebtp_extend + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP +--- +kind: Service +apiVersion: v1 +metadata: + name: biz-service-ebtp-extend-svc # [11] service的名字,格式为“服务名-svc” + namespace: default + labels: + service: biz-service-ebtp-extend-svc # [12] service的标签,可与参数[11]相同 + annotations: + prometheus.io/port: '18018' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同 + prometheus.io/jl-svc: 'true' + +spec: + ports: + - port: 18018 #[15] 与参数4相同 + targetPort: 18018 #[16] 与参数4相同 + selector: + app: biz-service-ebtp-extend #[17] 该service对应Deployment的名字,与参数[1]相同 +--- \ No newline at end of file diff --git a/deployment-sim.yaml b/deployment-sim.yaml new file mode 100644 index 0000000..50a52d0 --- /dev/null +++ b/deployment-sim.yaml @@ -0,0 +1,99 @@ +# 接口版本 +apiVersion: apps/v1 +# 接口类型 +kind: Deployment +metadata: + name: biz-service-ebtp-extend + namespace: default + labels: + app: biz-service-ebtp-extend + +# 必选,详细定义 +spec: + # pod 副本数量 + replicas: 3 + + # 滚动升级配置信息 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + + # 选择器,匹配pod模板 + selector: + matchLabels: + app: biz-service-ebtp-extend + + template: + metadata: + labels: + # 模板名称 + app: biz-service-ebtp-extend + annotations: + prometheus.io/port: '18018' + prometheus.io/jl-pod: 'true' + + # 定义容器模板,该模板可以包含多个容器 + spec: + volumes: + - name: log + persistentVolumeClaim: + claimName: log-pvc + readOnly: false + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - biz-service-ebtp-extend + topologyKey: "kubernetes.io/hostname" + # 必选,Pod中容器列表 + containers: + - name: biz-service-ebtp-extend + image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest + args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] + volumeMounts: + - name: log + mountPath: /log + ports: + - containerPort: 18018 + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 3000m + memory: 6Gi + env: + - name: AGENT_LICENCE + value: 527BFA7B28577578 + - name: APP_NAME + value: biz_service_ebtp_extend_sim + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP +--- +kind: Service +apiVersion: v1 +metadata: + name: biz-service-ebtp-extend-svc # [11] service的名字,格式为“服务名-svc” + namespace: default + labels: + service: biz-service-ebtp-extend-svc # [12] service的标签,可与参数[11]相同 + annotations: + prometheus.io/port: '18018' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同 + prometheus.io/jl-svc: 'true' + +spec: + ports: + - port: 18018 #[15] 与参数4相同 + targetPort: 18018 #[16] 与参数4相同 + selector: + app: biz-service-ebtp-extend #[17] 该service对应Deployment的名字,与参数[1]相同 +--- \ No newline at end of file diff --git a/deployment-test.yaml b/deployment-test.yaml deleted file mode 100644 index fd96120..0000000 --- a/deployment-test.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# 接口版本 -apiVersion: apps/v1 -# 接口类型 -kind: Deployment -metadata: - name: biz-service-ebtp-extend - namespace: default - labels: - app: biz-service-ebtp-extend - -# 必选,详细定义 -spec: - # pod 副本数量 - replicas: 1 - - # 滚动升级配置信息 - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 1 - - # 选择器,匹配pod模板 - selector: - matchLabels: - app: biz-service-ebtp-extend - - template: - metadata: - labels: - # 模板名称 - app: biz-service-ebtp-extend - annotations: - prometheus.io/port: '18018' - prometheus.io/jl-pod: 'true' - - # 定义容器模板,该模板可以包含多个容器 - spec: - # 必选,Pod中容器列表 - containers: - - name: biz-service-ebtp-extend - image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest - # 需要暴露的端口库号列表 - ports: - - containerPort: 18018 - # 容器运行前需设置的环境变量列表 - env: - # Apollo 配置中心变量设置 - - name: APOLLO_CONFIGSERVICE - value: http://10.242.37.1488:6001 - - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES - value: skywalking-oap-cluster.skywalking:11800 - - name: SW_AGENT_NAME - value: biz-service-ebtp-extend ---- -kind: Service -apiVersion: v1 -metadata: - name: biz-service-ebtp-extend - namespace: default - labels: - app: biz-service-ebtp-extend - annotations: - lb.cke.tg.unicom/target-vports: 18018-18018 - prometheus.io/port: '18018' - prometheus.io/jl-svc: 'true' -spec: - ports: - - port: 18018 - targetPort: 18018 - selector: - app: biz-service-ebtp-extend -status: - loadBalancer: {} - ---- \ No newline at end of file diff --git a/deployment-uat.yaml b/deployment-uat.yaml new file mode 100644 index 0000000..95e8e56 --- /dev/null +++ b/deployment-uat.yaml @@ -0,0 +1,106 @@ +# 接口版本 +apiVersion: apps/v1 +# 接口类型 +kind: Deployment +metadata: + name: biz-service-ebtp-extend + namespace: default + labels: + app: biz-service-ebtp-extend + +# 必选,详细定义 +spec: + # pod 副本数量 + replicas: 1 + + # 滚动升级配置信息 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + + # 选择器,匹配pod模板 + selector: + matchLabels: + app: biz-service-ebtp-extend + + template: + metadata: + labels: + # 模板名称 + app: biz-service-ebtp-extend + annotations: + prometheus.io/port: '18018' + prometheus.io/jl-pod: 'true' + + # 定义容器模板,该模板可以包含多个容器 + spec: + # 挂载日志存储 + volumes: + - name: log + persistentVolumeClaim: + claimName: log-pvc + readOnly: false + + # 必选,Pod中容器列表 + containers: + - name: biz-service-ebtp-extend + image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest + # 在容器中挂载日志存储区 + volumeMounts: + - name: log + mountPath: /log + # 需要暴露的端口库号列表 + ports: + - containerPort: 18018 + resources: + requests: + cpu: 2000m + memory: 4Gi + limits: + cpu: 4000m + memory: 8Gi + # 容器运行前需设置的环境变量列表 + env: + # Apollo 配置中心变量设置 + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP #自动获取pod ip作为agent id + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: JAVA_TOOL_OPTIONS + value: -XX:+UnlockExperimentalVMOptions + -XX:+UseContainerSupport + -XX:+UseCGroupMemoryLimitForHeap + -XX:InitialRAMPercentage=40.0 + -XX:MinRAMPercentage=20.0 + -XX:MaxRAMPercentage=80.0 + - name: APP_NAME + value: biz_service_ebtp_extend_uat + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP +--- +kind: Service +apiVersion: v1 +metadata: + name: biz-service-ebtp-extend + namespace: default + labels: + app: biz-service-ebtp-extend + annotations: + # lb.cke.tg.unicom/target-vports: 18018-18018 + prometheus.io/port: '18018' + prometheus.io/jl-svc: 'true' +spec: + ports: + - port: 18018 + targetPort: 18018 + selector: + app: biz-service-ebtp-extend +status: + loadBalancer: {} + +--- \ No newline at end of file diff --git a/pro.yaml b/pro.yaml index ba8569a..785b8f5 100644 --- a/pro.yaml +++ b/pro.yaml @@ -41,7 +41,7 @@ spec: containers: - name: biz-service-ebtp-extend #[6] 必选,容器名称,可填写微服务名称 image: harbor.dcos.xixian.unicom.local/eshop/biz-service-ebtp-extend:latest #[7] 镜像名称,请把biz-service-ebtp-extend替换为服务名称 - args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-Dspring.profiles.active=pro", "-jar", "/app.jar"] + args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] volumeMounts: - name: log mountPath: /log @@ -84,6 +84,14 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP + - name: JAVA_TOOL_OPTIONS + value: + -XX:+UnlockExperimentalVMOptions + -XX:+UseContainerSupport + -XX:+UseCGroupMemoryLimitForHeap + -XX:InitialRAMPercentage=40.0 + -XX:MinRAMPercentage=20.0 + -XX:MaxRAMPercentage=80.0 --- kind: Service apiVersion: v1 diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/BizServiceEbtpExtendApplication.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/BizServiceEbtpExtendApplication.java index 1187fe0..e05ac29 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/BizServiceEbtpExtendApplication.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/BizServiceEbtpExtendApplication.java @@ -4,6 +4,7 @@ import cn.hutool.core.lang.Snowflake; import cn.hutool.core.util.IdUtil; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure; import io.micrometer.core.instrument.MeterRegistry; +import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig; import org.mybatis.spring.annotation.MapperScan; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; @@ -21,6 +22,7 @@ import org.springframework.context.annotation.ComponentScan; @EnableEurekaClient @MapperScan({"com.chinaunicom.mall.ebtp.extend.**.dao"}) @ComponentScan("com.chinaunicom.mall.ebtp.*") +@EnableApolloConfig public class BizServiceEbtpExtendApplication { public static void main(String[] args) { diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-dev.yml similarity index 100% rename from src/main/resources/application-test.yml rename to src/main/resources/application-dev.yml diff --git a/src/main/resources/application-localpro.yml b/src/main/resources/application-localpro.yml new file mode 100644 index 0000000..eb40af5 --- /dev/null +++ b/src/main/resources/application-localpro.yml @@ -0,0 +1,153 @@ +server: + port: 18003 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + biz-service-ebtp-extend-local-service-group: seata-server-jl + registry: + type: eureka + eureka: + serviceUrl: http://10.238.25.112:5001/eureka,http://10.238.25.112:5002/eureka,http://10.238.25.112:5003/eureka + +# 对应 apollo 配置中心的应用名 +app: + id: biz-service-ebtp-extend + +# Apollo 配置信息 +apollo: + meta: http://10.238.25.112:6001/ + bootstrap: + namespace: application + enabled: true + eagerLoad: + enabled: true + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + application: + name: biz-service-ebtp-extend-local + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: auction + password: ProdMall3_0118auction + jdbc-url: jdbc:mysql://10.238.25.112:3001/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.238.25.112:3001/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + filters: stat,wall,log4j + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000 + props: + sql: + show: true + + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + serialization: + write-dates-as-timestamps: false + + # 生产区 redis 配置 + redis: + sentinel: + master: eshop-redis2 + nodes: 10.172.48.83:32521,10.172.48.100:32521,10.172.48.94:32561 + password: Unicom#135 + +# 天宫Eureka配置 +eureka: + client: + service-url: + defaultZone: http://10.238.25.112:5001/eureka,http://10.238.25.112:5002/eureka,http://10.238.25.112:5003/eureka + instance: + prefer-ip-address: true + instance-ip: ${spring.cloud.client.ip-address}:${server.port} + +mybatis-plus: + configuration: + # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射 + map-underscore-to-camel-case: true + auto-mapping-behavior: full + # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml + global-config: + # 逻辑删除配置 + db-config: + logic-not-delete-value: normal # 逻辑删除标记:正常数据 + logic-delete-value: deleted # 逻辑删除标记:已删除的数据 + +feign: + httpclient: + enabled: false + okhttp: + enabled: true + client: + config: + default: + connect-timeout: 20000 + read-timeout: 20000 +hystrix: + command: + default: + execution: + timeout: + enabled: true + isolation: + strategy: SEMAPHORE + thread: + timeoutInMilliseconds: 200000 #熔断超时时间 + circuitBreaker: + sleepWindowInMilliseconds: 20000 + forceClosed: true + +ribbon: + ReadTimeout: 20000 #请求处理的超时时间 + ConnectTimeout: 20000 #请求连接超时时间 + MaxAutoRetries: 0 #对当前实例的重试次数 + MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1 + +mconfig: + workerId: 1 + datacenterId: 1 + # 服务名 + feign: + name: + open: biz-service-ebtp-opening #开标大厅服务 + process: biz-service-ebtp-process #评审流程服务 + project: biz-service-ebtp-project #项目服务 + resps: biz-service-ebtp-resps #应答结构化服务 + rsms: biz-service-ebtp-rsms #评审结构化服务 + tender: biz-service-ebtp-tender #投标服务 + documentcenter: core-service-document-center #文档中心 +document: + clientHttpUrl: http://10.238.25.112:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-mster.yml similarity index 100% rename from src/main/resources/application-pro.yml rename to src/main/resources/application-mster.yml diff --git a/src/main/resources/application-uat.yml b/src/main/resources/application-uat.yml index ab1948b..9df047a 100644 --- a/src/main/resources/application-uat.yml +++ b/src/main/resources/application-uat.yml @@ -6,12 +6,11 @@ server: seata: service: vgroup-mapping: - biz-service-ebtp-extend-service-group: default - - #registry: - # type: eureka - # eureka: - # serviceUrl: http://10.242.31.158:5001/eureka,http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka + biz-service-ebtp-extend-service-group: seata-server-jl + registry: + type: eureka + eureka: + serviceUrl: http://eureka-1:8080/eureka,http://eureka-2:8080/eureka,http://eureka-3:8080/eureka # 对应 apollo 配置中心的应用名 app: @@ -19,7 +18,7 @@ app: # Apollo 配置信息 apollo: - meta: http://10.242.31.158:6001/ + meta: http://apollo-configservice:8080 bootstrap: namespace: application enabled: true @@ -102,12 +101,10 @@ spring: eureka: client: service-url: - defaultZone: http://10.242.31.158:5001/eureka,http://10.242.31.158:5002/eureka,http://10.242.31.158:5003/eureka + defaultZone: http://eureka-1:8080/eureka,http://eureka-2:8080/eureka,http://eureka-3:8080/eureka instance: prefer-ip-address: true - instance-id: http://10.242.31.158:${server.port} - # 这是客户端的注册地址, eureka 会通过这个地址建立管道 - ip-address: 10.242.31.158 + instance-ip: ${spring.cloud.client.ip-address}:${server.port} mybatis-plus: configuration: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f2b90d5..89394d5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,3 +1,9 @@ -spring: - profiles: - active: uat \ No newline at end of file +# 对应 apollo 配置中心的应用名 +app: + id: biz-service-ebtp-extend + +# Apollo 配置信息 +apollo: + bootstrap: + enabled: true + namespace: application \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index fde1240..0f35ed8 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -2,7 +2,7 @@ - + ${logback.appname} @@ -11,31 +11,21 @@ - %d{yyyy-MM-dd HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{50} - %msg%n + %d{yyyy-MM-dd HH:mm:ss.SSS} ${MY_POD_IP} %contextName [%thread] %-5level %logger{50}  - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n - - - - ERROR - - DENY - - ACCEPT - - ${logback.logdir}/info.${logback.appname}.log + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.log - ${logback.logdir}/info.${logback.appname}.%d{yyyy-MM-dd}.log + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.%d{yyyy-MM-dd}.log 3 @@ -46,35 +36,7 @@ UTF-8 - %d [%thread] %-5level %logger{64} %line - %msg%n - - - - - - - Error - - - ${logback.logdir}/error.${logback.appname}.log - - - - ${logback.logdir}/error.${logback.appname}.%d{yyyy-MM-dd}.log - - 3 - - true - - - - - - UTF-8 - %d [%thread] %-5level %logger{128} %line - %msg%n + %d ${MY_POD_IP} [%thread] %-5level %logger{64} %line - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n