From 330f04d9957a769e4402f53d1eefd9b24de649d8 Mon Sep 17 00:00:00 2001 From: dxc Date: Thu, 15 Apr 2021 10:54:15 +0800 Subject: [PATCH 1/8] 111 --- .../service/impl/ProjectReEvaluationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java index 15b3e7a..82dd10c 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java @@ -254,7 +254,7 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl standardNextParticipants = new ArrayList<>(); StandardNextParticipantVO participantVO = new StandardNextParticipantVO(); From 83f9da5d0aeb9dfba77bd70f37117b5538a8bbc9 Mon Sep 17 00:00:00 2001 From: dxc Date: Thu, 15 Apr 2021 10:57:58 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProjectReEvaluationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java index 82dd10c..15b3e7a 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/projectreevaluation/service/impl/ProjectReEvaluationServiceImpl.java @@ -254,7 +254,7 @@ public class ProjectReEvaluationServiceImpl extends BaseServiceImpl standardNextParticipants = new ArrayList<>(); StandardNextParticipantVO participantVO = new StandardNextParticipantVO(); From 6259c2493609a17f4758c9ca2998a8f5ce234621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Thu, 22 Apr 2021 14:29:15 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0JVM=E5=A0=86=E5=86=85?= =?UTF-8?q?=E5=AD=98=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pro.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pro.yaml b/pro.yaml index 3b48a80..f83d8fa 100644 --- a/pro.yaml +++ b/pro.yaml @@ -84,6 +84,15 @@ 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 From 8432da6c23c43f2311c7b42b1556f090ed9f7d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Thu, 22 Apr 2021 14:29:44 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/logback.xml | 115 +++++++++++---------------------- 1 file changed, 36 insertions(+), 79 deletions(-) diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index da621b2..c2b6235 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,89 +1,46 @@ - - + + ${logback.appname} - - - - - - %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}/info.${logback.appname}.%d{yyyy-MM-dd}.log - - 3 - - true - - - - - - 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 - - - - - - - - - - + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.log + + + + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.%d{yyyy-MM-dd}.log + + 3 + + true + + + + + + UTF-8 + %d ${MY_POD_IP} [%thread] %-5level %logger{64} %line  - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n + + + + + + + + From 61b1d3b445d7760b4b67bc4d4660c653ef7b9e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Thu, 22 Apr 2021 14:52:54 +0800 Subject: [PATCH 5/8] Update logback.xml --- src/main/resources/logback.xml | 78 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index c2b6235..d947716 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,46 +1,50 @@ - - + + ${logback.appname} - - - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} ${MY_POD_IP} %contextName [%thread] %-5level %logger{50}  - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %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 + + + - - - ${logback.logdir}/${logback.appname}-${MY_POD_IP}.log - - - - ${logback.logdir}/${logback.appname}-${MY_POD_IP}.%d{yyyy-MM-dd}.log - - 3 - - true - - - - - - UTF-8 - %d ${MY_POD_IP} [%thread] %-5level %logger{64} %line  - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n - - - - - - - - + + + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.log + + + + ${logback.logdir}/${logback.appname}-${MY_POD_IP}.%d{yyyy-MM-dd}.log + + 3 + + true + + + + + + UTF-8 + %d ${MY_POD_IP} [%thread] %-5level %logger{64} %line - [ppTraceId: %X{PtxId}, ppSpanId: %X{PspanId}] - %msg%n + + + + + + + + + From c2ba780567e6673aa6a2abd5553c7ef91b26389e Mon Sep 17 00:00:00 2001 From: dxc Date: Thu, 13 May 2021 16:18:46 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-sim.yml | 176 +++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 src/main/resources/application-sim.yml diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml new file mode 100644 index 0000000..2ce4367 --- /dev/null +++ b/src/main/resources/application-sim.yml @@ -0,0 +1,176 @@ +server: + port: 18012 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + biz-service-ebtp-project-service-group: seata-server-jl + registry: + type: eureka + eureka: + serviceUrl: http://eureka-1-svc:8080/eureka,http://eureka-2-svc:8080/eureka,http://eureka-3-svc:8080/eureka + +# 对应 apollo 配置中心的应用名 +app: + id: biz-service-ebtp-project + +# Apollo 配置信息 +apollo: + meta: http://10.242.31.54:6002/ + bootstrap: + namespace: application + enabled: true + eagerLoad: + enabled: true + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: biz-service-ebtp-project + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicom + jdbc-url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_project?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_project?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: false + + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + serialization: + write-dates-as-timestamps: false + + # 天宫Kafka增加了安全认证,需要配置安全属性 + kafka: + bootstrap-servers: 10.172.48.110:32050,10.172.48.109:32050,10.172.48.111:32050 + template: + default-topic: jl_eshop + + # 生产者配置参数 + producer: + client-id: core-service-ebtp-crypt + properties: + security.protocol: SASL_PLAINTEXT + sasl.mechanism: SCRAM-SHA-256 + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + + # 消费者配置参数 + consumer: + group-id: core-service-ebtp-crypt-consumer + auto-offset-reset: latest + properties: + security.protocol: SASL_PLAINTEXT + sasl.mechanism: SCRAM-SHA-256 + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + + # 生产区 redis 配置 + redis: + sentinel: + master: eshop-redis-sim + nodes: 10.125.164.24:32510,10.125.164.90:32515,10.125.164.89:32516 + password: Unicom#135 + +# 天宫Eureka配置 +eureka: + client: + service-url: + defaultZone: http://eureka-1-svc:8080/eureka,http://eureka-2-svc:8080/eureka,http://eureka-3-svc:8080/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 # 逻辑删除标记:已删除的数据 + type-aliases-package: com.chinaunicom.mall.ebtp.project + +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: + swagger-ui-open: true + exception-handle-enabled: true + seata-open-enabled: false + work-id: 1 #终端ID + datacenter-id: 1 #数据中心ID + host-name: http://10.238.25.112/ + service-name-purp: mall-purp #采购系统委托项目微服务 + service-name-wfap: mall-wfap #重新评审 流程微服务 + service-name-resu: mall-resu #重新评审 项目中心查询服务 + service-price-query: biz-service-price-query #商城询价服务 + service-price-usercenter: core-service-usercenter-public #用户中心服务 + #内部服务 + service-name-archive: biz-service-ebtp-archive #归档服务 + service-name-auction: biz-service-ebtp-auction #竞拍服务API + service-name-calibration: biz-service-ebtp-calibration #标段定标接口 + service-name-bid: biz-service-ebtp-bid #标段出始化流程 + service-name-process: biz-service-ebtp-process #标段出始化流程 + service-name-resps: biz-service-ebtp-resps #标段应答文件 + service-name-rsms: biz-service-ebtp-rsms #评审微服务 + service-name-tender: biz-service-ebtp-tender #标段投标微服务 + wfSectionNo: '080' + wfSectionName: 标段重新评审审批单 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" \ No newline at end of file From 4d742f6928aa66f4b7e754d4dad62020e40b540a Mon Sep 17 00:00:00 2001 From: dxc Date: Thu, 13 May 2021 16:21:40 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-sim.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 2ce4367..6fc56c8 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -69,7 +69,7 @@ spring: # 天宫Kafka增加了安全认证,需要配置安全属性 kafka: - bootstrap-servers: 10.172.48.110:32050,10.172.48.109:32050,10.172.48.111:32050 + bootstrap-servers: 10.125.164.24:32002,10.125.164.192:32096,10.125.164.89:32002 template: default-topic: jl_eshop @@ -79,7 +79,7 @@ spring: properties: security.protocol: SASL_PLAINTEXT sasl.mechanism: SCRAM-SHA-256 - sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka-sim" password="Unicom#135"; # 消费者配置参数 consumer: @@ -88,7 +88,7 @@ spring: properties: security.protocol: SASL_PLAINTEXT sasl.mechanism: SCRAM-SHA-256 - sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka-sim" password="Unicom#135"; # 生产区 redis 配置 redis: From 680543a1faf34f0148f1bced3133fb6a753f0e92 Mon Sep 17 00:00:00 2001 From: dxc Date: Fri, 14 May 2021 09:33:07 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=91=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=90=AF=E5=8A=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployment-sim.yaml | 114 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 deployment-sim.yaml diff --git a/deployment-sim.yaml b/deployment-sim.yaml new file mode 100644 index 0000000..2ffddf3 --- /dev/null +++ b/deployment-sim.yaml @@ -0,0 +1,114 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: biz-service-ebtp-project #[1] Deployment名称,可填写微服务名称 + namespace: default + labels: + app: biz-service-ebtp-project + +spec: + replicas: 3 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + selector: + matchLabels: + app: biz-service-ebtp-project #[2] 选择器匹配时标签名称,可填写微服务名称 + template: + metadata: + labels: + app: biz-service-ebtp-project #[3] 模板名称,可填写微服务名称 + annotations: + prometheus.io/port: '18012' + 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-project + topologyKey: "kubernetes.io/hostname" + containers: + - name: biz-service-ebtp-project #[6] 必选,容器名称,可填写微服务名称 + image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-project:latest #[7] 镜像名称,请把biz-service-ebtp-project替换为服务名称 + 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=sim", "-jar", "/app.jar"] + volumeMounts: + - name: log + mountPath: /log + ports: + - containerPort: 18012 #[8] 容器需要监听的端口号,与配置文件中的server.port参数相同,与参数[4]相同 +# livenessProbe: +# failureThreshold: 3 +# httpGet: +# port: 18012 #[11] pod存活检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 +# path: /actuator/prometheus +# scheme: HTTP +# initialDelaySeconds: 300 +# periodSeconds: 60 +# successThreshold: 1 +# timeoutSeconds: 2 +# readinessProbe: +# failureThreshold: 1 +# httpGet: +# port: 18012 #[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: APP_NAME + value: biz_ebtp_project + - name: AGENT_LICENCE + value: 527BFA7B28577578 + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP + 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 +metadata: + name: biz-service-ebtp-project-svc # [11] service的名字,格式为“服务名-svc” + namespace: default + labels: + service: biz-service-ebtp-project-svc # [12] service的标签,可与参数[11]相同 + annotations: + prometheus.io/port: '18012' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同 + prometheus.io/jl-svc: 'true' + +spec: + ports: + - port: 18012 #[15] 与参数4相同 + targetPort: 18012 #[16] 与参数4相同 + selector: + app: biz-service-ebtp-project #[17] 该service对应Deployment的名字,与参数[1]相同 +--- \ No newline at end of file