8f0eb5d7 by 肖初晴

初始化

0 parents
HELP.md
target/
#!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
.mvn
src/test
src/main/resources/application-dev.yml
src/main/resources/bootstrap-dev.yml
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
ARG BASE_IMAGE_URL
FROM $BASE_IMAGE_URL/csbr/java:openjdk-17-jdk-alpine
VOLUME /tmp
ARG CE=$CE
ARG PROMETHEUS_PARAMS=$PROMETHEUS_PARAMS
ARG SKYWALKING_PARAMS=$SKYWALKING_PARAMS
ENV CE=$CE
ENV PROMETHEUS_PARAMS=$PROMETHEUS_PARAMS
ENV SKYWALKING_PARAMS=$SKYWALKING_PARAMS
ENV TZ=Asia/Shanghai
#ARG JAR_FILE
#COPY ${JAR_FILE} mscrm.jar
#RUN bash -c 'touch /mscrm.jar'
ADD target/ms-data-circulation-portal-service.jar ms-data-circulation-portal-service.jar
# 指定容器内的时区
RUN echo "Asia/Shanghai" > /etc/timezone
ENV CE=$CE
#ENV JAVA_OPTS=$JAVA_OPTS
EXPOSE 19210
RUN echo "当前Docker环境:$CE" && echo "当前监控参数:$PROMETHEUS_PARAMS"
ENTRYPOINT ["sh", "-c","java -Xms256m -Xmx1024m $PROMETHEUS_PARAMS $SKYWALKING_PARAMS -Djava.security.egd=file:/dev/./urandom -jar /ms-data-circulation-portal-service.jar --spring.cloud.config.profile=$CE"]
\ No newline at end of file
pipeline {
agent any
parameters{
choice(
description: '你需要选择哪个环境部署?',
name: 'deploy_env',
choices: ['heart-pre-release','heart-test']
)
}
//环境定义
environment{
//日志映射路径
LOG_PATH = "/mnt/log/"
//服务名称
SVN_FOLD = readMavenPom().getArtifactId()
SSH_PATH = "csbr5.3"
//镜像版本号
image_tag = readMavenPom().getVersion()
//docker私服ip
ip = "192.168.5.4:82"
//微服务端口号
port = "9199"
}
//定时任务
//triggers { pollSCM('H 4/* 0 0 1-5') }
//triggers {
//每天凌晨2点自动构建
// cron('H 2 * * *')
//}
options {
// 设置保留的最大历史构建数为6
buildDiscarder(logRotator(numToKeepStr: '2'))
}
//全局定义工具
tools {
//工具名称必须在Jenkins 管理Jenkins → 全局工具配置中预配置。
maven 'maven3'
jdk 'JDK17'
}
stages {
stage('heart-pre-release'){
when{
expression{return params.deploy_env=='heart-pre-release'}
}
steps{
script{
env.SVN_TYPE = "pre-release"
}
}
}
stage('heart-test'){
when{
expression{return params.deploy_env=='heart-test'}
}
steps{
script{
env.SVN_TYPE = "test"
}
}
}
//构建
stage('Maven Build') {
steps {
//sh './gradlew build'
//执行shell命令
sh 'echo ${JAVA_HOMOE}'
sh "mvn -f ./pom.xml clean package -Dmaven.test.skip=true -X -P${params.deploy_env}"
//sh 'mvn -f ${SVN_FOLD}/pom.xml clean package'
}
}
stage('Docker Build') {
steps {
//分分支构建
script{
//develop分支环境
echo 'start to deploy ${SVN_FOLD} on test ...'
sh '''
CID=$(docker ps -a | grep "${SVN_FOLD}" | awk '{print $1}')
IID=$(docker images | grep "none" | awk '{print $3}')
cp "$WORKSPACE"/target/"${SVN_FOLD}".jar "$WORKSPACE"
if [ -n "$IID" ]; then
echo "存在'${SVN_FOLD}'镜像,IID='$IID'"
cd "$WORKSPACE"
##构建镜像到远程仓库
docker login "${ip}" -u admin -p E6w611g864wQ2
docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" .
docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}"
else
echo "不存在'${SVN_FOLD}'镜像,开始构建镜像"
##构建镜像到远程仓库
docker login "${ip}" -u admin -p E6w611g864wQ2
docker build -t "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}" .
docker push "${ip}"/csbr/"${SVN_FOLD}""-${SVN_TYPE}":"${image_tag}"
fi
'''
echo 'Depoly ${SVN_FOLD} develop success ...'
}
}
}
//部署
stage('Deploy') {
steps {
echo 'Deploying'
//分分支部署
script{
//develop分支环境
echo 'start to deploy ${SVN_FOLD} on test ...'
//调用Publish Over SSH插件,上传docker-compose.yaml文件并且执行deploy脚本
sshPublisher(publishers: [sshPublisherDesc(configName: "$SSH_PATH", transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: """
echo "日志路径 '$LOG_PATH''$SVN_FOLD'"
#使用k8s构建
kubectl delete -f /mnt/k8s/${params.deploy_env}/ms-data-circulation-portal-service.yaml
kubectl apply -f /mnt/k8s/${params.deploy_env}/ms-data-circulation-portal-service.yaml
""", execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/mnt/csbr/data', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'output/*.*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
echo 'Depoly ${SVN_FOLD} success ...'
}
//sh './build.sh'
}
}
}
//归档
post {
always {
echo 'Archive artifacts'
archiveArtifacts artifacts: "**/target/*.jar", excludes: "**/target"
}
}
}
\ No newline at end of file
File mode changed
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.5</version>
<relativePath/>
</parent>
<groupId>com.csbr.qingcloud.portal</groupId>
<artifactId>ms-data-circulation-portal-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ms-data-circulation-portal-service</name>
<properties>
<log4j2.version>2.15.0</log4j2.version>
<cabr-package.version>1.0.5-daop</cabr-package.version>
<!--docker镜像前缀-->
<docker.image.prefix>springio</docker.image.prefix>
</properties>
<dependencies>
<dependency>
<groupId>com.csbr.qingcloud</groupId>
<artifactId>csbr-cloud-common</artifactId>
<version>${cabr-package.version}</version>
</dependency>
<dependency>
<groupId>com.csbr.qingcloud</groupId>
<artifactId>csbr-cloud-workflow</artifactId>
<version>${cabr-package.version}</version>
</dependency>
<dependency>
<groupId>com.csbr.qingcloud</groupId>
<artifactId>csbr-cloud-base</artifactId>
<version>${cabr-package.version}</version>
</dependency>
<dependency>
<groupId>com.csbr.qingcloud</groupId>
<artifactId>csbr-cloud-log</artifactId>
<version>${cabr-package.version}</version>
</dependency>
<dependency>
<groupId>com.csbr.qingcloud</groupId>
<artifactId>csbr-cloud-mybatis</artifactId>
<version>${cabr-package.version}</version>
</dependency>
<dependency>
<groupId>com.csbr.qingcloud</groupId>
<artifactId>csbr-cloud-swagger</artifactId>
<version>${cabr-package.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.9</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.12</version>
</dependency>
</dependencies>
<build>
<finalName>ms-data-circulation-portal-service</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource><!--此处的设置是打包的时候排除不相关的目录-->
<directory>src/main/resources</directory>
<!--此处设置为上面在resources目录下创建的文件夹-->
<excludes>
<exclude>release/*</exclude>
<exclude>develop/*</exclude>
<exclude>release-test/*</exclude>
</excludes>
<!--开启过滤器,此处不能忽略!-->
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources/${profileActive}/${subPath}</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>develop-daop-master</id>
<properties>
<profileActive>develop</profileActive>
<subPath></subPath>
</properties>
</profile>
<profile>
<id>develop-daop-lt</id>
<properties>
<profileActive>develop</profileActive>
<subPath>lt</subPath>
</properties>
</profile>
<profile>
<id>develop-daop-zcgl</id>
<properties>
<profileActive>develop</profileActive>
<subPath>zcgl</subPath>
</properties>
</profile>
<profile>
<id>develop-daop-jgjf</id>
<properties>
<profileActive>develop</profileActive>
<subPath>jgjf</subPath>
</properties>
</profile>
<profile>
<id>develop-daop-project</id>
<properties>
<profileActive>develop</profileActive>
<subPath>project</subPath>
</properties>
</profile>
<profile>
<id>release-test-daop-master</id>
<properties>
<profileActive>release-test</profileActive>
<subPath></subPath>
</properties>
</profile>
<profile>
<id>release-test-daop-lt</id>
<properties>
<profileActive>release-test</profileActive>
<subPath>lt</subPath>
</properties>
</profile>
<profile>
<id>release-test-daop-zcgl</id>
<properties>
<profileActive>release-test</profileActive>
<subPath>zcgl</subPath>
</properties>
</profile>
<profile>
<id>release-test-daop-jgjf</id>
<properties>
<profileActive>release-test</profileActive>
<subPath>jgjf</subPath>
</properties>
</profile>
<profile>
<id>release-test-daop-project</id>
<properties>
<profileActive>release-test</profileActive>
<subPath>project</subPath>
</properties>
</profile>
<profile>
<id>production-daop-master</id>
<properties>
<profileActive>release</profileActive>
<subPath></subPath>
</properties>
</profile>
<profile>
<id>production-daop-lt</id>
<properties>
<profileActive>release</profileActive>
<subPath>lt</subPath>
</properties>
</profile>
<profile>
<id>production-daop-zcgl</id>
<properties>
<profileActive>release</profileActive>
<subPath>zcgl</subPath>
</properties>
</profile>
<profile>
<id>production-daop-jgjf</id>
<properties>
<profileActive>release</profileActive>
<subPath>jgjf</subPath>
</properties>
</profile>
<profile>
<id>production-daop-project</id>
<properties>
<profileActive>release</profileActive>
<subPath>project</subPath>
</properties>
</profile>
</profiles>
</project>
package com.csbr.qingcloud.portal;
import io.seata.spring.annotation.datasource.EnableAutoDataSourceProxy;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.RestController;
/**
* @author XiaoCQ
* @description: 门户服务
* @since 2024-12-17
**/
@SpringBootApplication(exclude ={DataSourceAutoConfiguration.class} )
@MapperScan(basePackages = {"com.csbr.qingcloud.portal.mybatis.mapper", "com.csbr.cloud.mybatis.mapper"})
@ComponentScan({"com.csbr.qingcloud.portal.*","com.csbr.cloud.common.*","com.csbr.cloud.mybatis.service.*", "com.csbr.cloud.mybatis.*"})
@EnableFeignClients(basePackages = {"com.csbr.cloud.*.feign", "com.csbr.qingcloud.portal.feign"})
@RefreshScope
@EnableDiscoveryClient
@Slf4j
@EnableScheduling
@RestController
@EnableAutoDataSourceProxy
public class MsServiceApplication {
public static void main(String[] args) {
System.setProperty("nacos.logging.default.config.enabled","false");
SpringApplication.run(MsServiceApplication.class, args);
log.info("[========================>>>>>>>>>>>>>>服务已启动<<<<<<<<<<<<<<========================]");
}
}
server:
port: 19210
monitor:
log-white:
#服务全局名称
spring:
application:
name: ms-data-circulation-portal-service
jackson:
time-zone: Asia/Shanghai
cloud:
inetutils:
ignored-interfaces: docker0 # 让应用忽略docker0网卡
compatibility-verifier:
enabled: false
gateway:
gatewayServiceName: gateway-server
host: 114.115.131.96
kafka:
bootstrap-servers: kafka-cs-develop.daop:9092
producer:
retries: 3
main:
allow-bean-definition-overriding: true
datasource:
sql-script-encoding: utf-8
#type: org.apache.commons.dbcp2.BasicDataSource
#如果使用TCC事务这个type必须指定,否则会抛出: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;
dynamic:
primary: master
druid:
initial-size: 0
max-active: 50
min-idle: 2
max-wait: -1
min-evictable-idle-time-millis: 30000
max-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 0
validation-query: select 1
validation-query-timeout: -1
test-on-borrow: false
test-on-return: false
test-while-idle: true
pool-prepared-statements: true
# max-open-prepared-statements: 100
filters: stat,wall
share-prepared-statements: true
wall:
config:
condition-double-const-allow: true
condition-and-alway-true-allow: true
##由mycat管理读写分离 不用代码控制(填写mycat的链接库)
datasource:
master:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
slave:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
# redis配置
data:
redis:
# 集群
#cluster:
# nodes: redis-service.redis:6379
# 单节点
host: redis-service.daop
port: 6379
password: "J7e411m693cA9"
timeout: 1000
prefix: daop-develop
jedis:
pool:
max-idle: 8
max-wait: 2000
min-idle: 0
max-active: 100
test-on-borrow: true
test-while-idle: true
sql:
init:
schema-locations: classpath*:init.sql
encoding: UTF-8
mode: never
redisson:
address: redis://redis-service.daop:6379
password: "J7e411m693cA9"
seata:
enabled: true # 1.0新特性,需要依赖seata-spring-boot-starter,默认为true
tx-service-group: my_test_tx_group
application-id: ms-data-circulation-portal-service
registry:
type: nacos
nacos:
application: seata-server
cluster: seata-cluster
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
password: U9u457p155vH@8
username: nacos
namespace: daop-master
group: develop
service:
vgroupMapping:
my_test_tx_group: seata-cluster
grouplist:
default: ms-daop-seata-service-develop:8091
#数据库字段开启驼峰
mybatis:
configuration:
map-underscore-to-camel-case: true
callSettersOnNulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
global-config:
db-config:
id-type: ASSIGN_UUID
logic-delete-value: "null"
logic-not-delete-value: N
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.csbr.qingcloud.configure.mybatis
##生产环境屏蔽此配置 优化性能
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
csbr:
kafka:
topic-prefix: DAOP-DEVELOP
consumer:
# 开启kafka消费者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 是否启用自动提交 offset
enable-auto-commit: false
# 自动提交间隔时间(MS),仅在自动提交开启时有效
auto-commit-interval: 100
# 自动重置 offset。 latest:从最后开始,earliest: 从 offset 为 0 开始
auto-offset-reset: latest
# 消息 key 的反序列化方法
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# 消息 value 的反序列化方法
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# listener 开启的线程数
concurrency: 2
# session 超时时间
session-timeout: 60000
# 最大 poll 消息间隔时间,如果处理时间过长会导致异常
max-poll-interval: 10000
# 最大 poll 消息数量
max-poll-records: 2
producer:
# 开启kafka生产者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,多地址用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 失败后的重发次数
retries: 0
# 一次最多发送的数据量
batch-size: 4096
# 32M批处理缓冲区
buffer-memory: 33554432
# 生产者生产消息间隔,数值越大,间隔越长,用来减缓消费压力
linger: 1
feign:
hystrix:
enabled: false
query-limit:
white: TrTaskValid
spring:
application:
name: ms-data-circulation-portal-service
cloud:
nacos:
#配置中心
config:
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
file-extension: yaml
group: develop
namespace: daop-master
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新(auto-refresh、enable-remote-sync-config两者缺一不可)
auto-refresh: true
# 允许nacos服务端向本地同步配置
enable-remote-sync-config: true
#注册中心
discovery:
enabled: true
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
ip: 192.168.6.20
group: develop
namespace: daop-master
metadata:
code: "006"
user:
name: nacos
password: nacos
management:
context-path: /actuator
#接口限流
sentinel:
transport:
# port: 7777
dashboard: sentinel-service.nacos-cluster:8858
#取消懒加载
eager: true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
###暂时禁用rabbit的健康检查
health:
rabbit:
enabled: false
sentinel:
enabled: false
feign:
sentinel:
enabled: true
\ No newline at end of file
server:
port: 19210
monitor:
log-white:
#服务全局名称
spring:
application:
name: ms-data-circulation-portal-service
jackson:
time-zone: Asia/Shanghai
cloud:
inetutils:
ignored-interfaces: docker0 # 让应用忽略docker0网卡
compatibility-verifier:
enabled: false
gateway:
gatewayServiceName: gateway-server
host: 114.115.131.96
kafka:
bootstrap-servers: kafka-cs-develop.daop:9092
producer:
retries: 3
main:
allow-bean-definition-overriding: true
datasource:
sql-script-encoding: utf-8
#type: org.apache.commons.dbcp2.BasicDataSource
#如果使用TCC事务这个type必须指定,否则会抛出: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;
dynamic:
primary: master
druid:
initial-size: 0
max-active: 50
min-idle: 2
max-wait: -1
min-evictable-idle-time-millis: 30000
max-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 0
validation-query: select 1
validation-query-timeout: -1
test-on-borrow: false
test-on-return: false
test-while-idle: true
pool-prepared-statements: true
# max-open-prepared-statements: 100
filters: stat,wall
share-prepared-statements: true
wall:
config:
condition-double-const-allow: true
condition-and-alway-true-allow: true
##由mycat管理读写分离 不用代码控制(填写mycat的链接库)
datasource:
master:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
slave:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
# redis配置
data:
redis:
# 集群
#cluster:
# nodes: redis-service.redis:6379
# 单节点
host: redis-service.daop
port: 6379
password: "J7e411m693cA9"
timeout: 1000
prefix: daop-develop
jedis:
pool:
max-idle: 8
max-wait: 2000
min-idle: 0
max-active: 100
test-on-borrow: true
test-while-idle: true
sql:
init:
schema-locations: classpath*:init.sql
encoding: UTF-8
mode: never
redisson:
address: redis://redis-service.daop:6379
password: "J7e411m693cA9"
seata:
enabled: true # 1.0新特性,需要依赖seata-spring-boot-starter,默认为true
tx-service-group: my_test_tx_group
application-id: ms-data-circulation-portal-service
registry:
type: nacos
nacos:
application: seata-server
cluster: seata-cluster
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
password: U9u457p155vH@8
username: nacos
namespace: daop-lt
group: develop
service:
vgroupMapping:
my_test_tx_group: seata-cluster
grouplist:
default: ms-daop-seata-service-develop:8091
#数据库字段开启驼峰
mybatis:
configuration:
map-underscore-to-camel-case: true
callSettersOnNulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
global-config:
db-config:
id-type: ASSIGN_UUID
logic-delete-value: "null"
logic-not-delete-value: N
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.csbr.qingcloud.configure.mybatis
##生产环境屏蔽此配置 优化性能
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
csbr:
kafka:
topic-prefix: DAOP-LT-DEVELOP
consumer:
# 开启kafka消费者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 是否启用自动提交 offset
enable-auto-commit: false
# 自动提交间隔时间(MS),仅在自动提交开启时有效
auto-commit-interval: 100
# 自动重置 offset。 latest:从最后开始,earliest: 从 offset 为 0 开始
auto-offset-reset: latest
# 消息 key 的反序列化方法
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# 消息 value 的反序列化方法
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# listener 开启的线程数
concurrency: 2
# session 超时时间
session-timeout: 60000
# 最大 poll 消息间隔时间,如果处理时间过长会导致异常
max-poll-interval: 10000
# 最大 poll 消息数量
max-poll-records: 2
producer:
# 开启kafka生产者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,多地址用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 失败后的重发次数
retries: 0
# 一次最多发送的数据量
batch-size: 4096
# 32M批处理缓冲区
buffer-memory: 33554432
# 生产者生产消息间隔,数值越大,间隔越长,用来减缓消费压力
linger: 1
feign:
hystrix:
enabled: false
query-limit:
white: TrTaskValid
spring:
application:
name: ms-data-circulation-portal-service
cloud:
nacos:
#配置中心
config:
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
file-extension: yaml
group: develop
namespace: daop-lt
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新(auto-refresh、enable-remote-sync-config两者缺一不可)
auto-refresh: true
# 允许nacos服务端向本地同步配置
enable-remote-sync-config: true
#注册中心
discovery:
enabled: true
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
ip: 192.168.6.20
port: 19207
group: develop
namespace: daop-lt
metadata:
code: "006"
user:
name: nacos
password: nacos
management:
context-path: /actuator
#接口限流
sentinel:
transport:
# port: 7777
dashboard: sentinel-service.nacos-cluster:8858
#取消懒加载
eager: true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
###暂时禁用rabbit的健康检查
health:
rabbit:
enabled: false
sentinel:
enabled: false
feign:
sentinel:
enabled: true
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 本地服务的名称 -->
<springProperty scope="context" name="app_name" source="spring.application.name"/>
<contextName>${app_name}</contextName>
<!-- 包含 logback 的基础配置,路径就是所在包 -->
<include resource="com/csbr/cloud/common/logback/logback-base.xml"/>
<!-- 增加skywalking配置日志收集-->
<appender name="grpc-log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n</Pattern>
</layout>
</encoder>
</appender>
<!-- 控制打印输出的内容 -->
<root level="INFO">
<appender-ref ref="FILE_ERROR"/>
<!-- <appender-ref ref="FILE_WARN"/>-->
<appender-ref ref="FILE_INFO"/>
<!-- 控制台 输出-->
<appender-ref ref="STDOUT"/>
<appender-ref ref="grpc-log"/>
</root>
<springProperty scope="context" name="kafka_server" source="spring.kafka.bootstrap-servers" />
<springProperty scope="context" name="topci_prefix" source="csbr.kafka.topic-prefix" />
<!-- 输出到Kafka -->
<appender name="kafkaAppender" class="com.csbr.cloud.common.logback.KafkaAppender">
<bootstrapServers>${kafka_server}</bootstrapServers>
<topic>csbr_fbt_log</topic>
<prefix>${topci_prefix}</prefix>
<formatter class="com.csbr.cloud.common.logback.JsonFormatter">
<expectJson>false</expectJson>
</formatter>
</appender>
<logger name="com.csbr.cloud.common.exception.GlobalExceptionHandler" level="ERROR" additivity="true">
<appender-ref ref="kafkaAppender"></appender-ref>
</logger>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 本地服务的名称 -->
<property name="app_name" value="ms-data-circulation-portal-service"/>
<!-- 包含 logback 的基础配置,路径就是所在包 -->
<include resource="com/csbr/cloud/common/logback/logback-base.xml"/>
<!-- 控制打印输出的内容 -->
<root level="INFO">
<appender-ref ref="FILE_ERROR"/>
<!-- <appender-ref ref="FILE_WARN"/>-->
<appender-ref ref="FILE_INFO"/>
<!-- 控制台 输出-->
<appender-ref ref="STDOUT"/>
</root>
<logger name="org.apache.kafka.clients.NetworkClient" level="Error" />
</configuration>
\ No newline at end of file
server:
port: 19210
monitor:
log-white:
#服务全局名称
spring:
application:
name: ms-data-circulation-portal-service
jackson:
time-zone: Asia/Shanghai
cloud:
inetutils:
ignored-interfaces: docker0 # 让应用忽略docker0网卡
compatibility-verifier:
enabled: false
gateway:
gatewayServiceName: gateway-server
host: 114.115.131.96
kafka:
bootstrap-servers: kafka-cs-develop.daop:9092
producer:
retries: 3
main:
allow-bean-definition-overriding: true
datasource:
sql-script-encoding: utf-8
#type: org.apache.commons.dbcp2.BasicDataSource
#如果使用TCC事务这个type必须指定,否则会抛出: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;
dynamic:
primary: master
druid:
initial-size: 0
max-active: 50
min-idle: 2
max-wait: -1
min-evictable-idle-time-millis: 30000
max-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 0
validation-query: select 1
validation-query-timeout: -1
test-on-borrow: false
test-on-return: false
test-while-idle: true
pool-prepared-statements: true
# max-open-prepared-statements: 100
filters: stat,wall
share-prepared-statements: true
wall:
config:
condition-double-const-allow: true
condition-and-alway-true-allow: true
##由mycat管理读写分离 不用代码控制(填写mycat的链接库)
datasource:
master:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
slave:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
# redis配置
data:
redis:
# 集群
#cluster:
# nodes: redis-service.redis:6379
# 单节点
host: redis-service.daop
port: 6379
password: "J7e411m693cA9"
timeout: 1000
prefix: daop-test
jedis:
pool:
max-idle: 8
max-wait: 2000
min-idle: 0
max-active: 100
test-on-borrow: true
test-while-idle: true
sql:
init:
schema-locations: classpath*:init.sql
encoding: UTF-8
mode: never
redisson:
address: redis://redis-service.daop:6379
password: "J7e411m693cA9"
seata:
enabled: true # 1.0新特性,需要依赖seata-spring-boot-starter,默认为true
tx-service-group: my_test_tx_group
application-id: ms-data-circulation-portal-service
registry:
type: nacos
nacos:
application: seata-server
cluster: seata-cluster
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
password: U9u457p155vH@8
username: nacos
namespace: daop-master
group: test
service:
vgroupMapping:
my_test_tx_group: seata-cluster
grouplist:
default: ms-daop-seata-service-develop:8091
#数据库字段开启驼峰
mybatis:
configuration:
map-underscore-to-camel-case: true
callSettersOnNulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
global-config:
db-config:
id-type: ASSIGN_UUID
logic-delete-value: "null"
logic-not-delete-value: N
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.csbr.qingcloud.configure.mybatis
##生产环境屏蔽此配置 优化性能
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
csbr:
kafka:
topic-prefix: DAOP-TEST
consumer:
# 开启kafka消费者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 是否启用自动提交 offset
enable-auto-commit: false
# 自动提交间隔时间(MS),仅在自动提交开启时有效
auto-commit-interval: 100
# 自动重置 offset。 latest:从最后开始,earliest: 从 offset 为 0 开始
auto-offset-reset: latest
# 消息 key 的反序列化方法
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# 消息 value 的反序列化方法
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# listener 开启的线程数
concurrency: 2
# session 超时时间
session-timeout: 60000
# 最大 poll 消息间隔时间,如果处理时间过长会导致异常
max-poll-interval: 10000
# 最大 poll 消息数量
max-poll-records: 2
producer:
# 开启kafka生产者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,多地址用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 失败后的重发次数
retries: 0
# 一次最多发送的数据量
batch-size: 4096
# 32M批处理缓冲区
buffer-memory: 33554432
# 生产者生产消息间隔,数值越大,间隔越长,用来减缓消费压力
linger: 1
feign:
hystrix:
enabled: false
query-limit:
white: TrTaskValid
spring:
application:
name: ms-data-circulation-portal-service
cloud:
nacos:
#配置中心
config:
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
file-extension: yaml
group: test
namespace: daop-master
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新(auto-refresh、enable-remote-sync-config两者缺一不可)
auto-refresh: true
# 允许nacos服务端向本地同步配置
enable-remote-sync-config: true
#注册中心
discovery:
enabled: true
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
group: test
namespace: daop-master
metadata:
code: "006"
user:
name: nacos
password: nacos
management:
context-path: /actuator
#接口限流
sentinel:
transport:
# port: 7777
dashboard: sentinel-service.nacos-cluster:8858
#取消懒加载
eager: true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
###暂时禁用rabbit的健康检查
health:
rabbit:
enabled: false
sentinel:
enabled: false
feign:
sentinel:
enabled: true
\ No newline at end of file
server:
port: 19210
monitor:
log-white:
#服务全局名称
spring:
application:
name: ms-data-circulation-portal-service
jackson:
time-zone: Asia/Shanghai
cloud:
inetutils:
ignored-interfaces: docker0 # 让应用忽略docker0网卡
compatibility-verifier:
enabled: false
gateway:
gatewayServiceName: gateway-server
host: 114.115.131.96
kafka:
bootstrap-servers: kafka-cs-develop.daop:9092
producer:
retries: 3
main:
allow-bean-definition-overriding: true
datasource:
sql-script-encoding: utf-8
#type: org.apache.commons.dbcp2.BasicDataSource
#如果使用TCC事务这个type必须指定,否则会抛出: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;
dynamic:
primary: master
druid:
initial-size: 0
max-active: 50
min-idle: 2
max-wait: -1
min-evictable-idle-time-millis: 30000
max-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 0
validation-query: select 1
validation-query-timeout: -1
test-on-borrow: false
test-on-return: false
test-while-idle: true
pool-prepared-statements: true
# max-open-prepared-statements: 100
filters: stat,wall
share-prepared-statements: true
wall:
config:
condition-double-const-allow: true
condition-and-alway-true-allow: true
##由mycat管理读写分离 不用代码控制(填写mycat的链接库)
datasource:
master:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
slave:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
# redis配置
data:
redis:
# 集群
#cluster:
# nodes: redis-service.redis:6379
# 单节点
host: redis-service.daop
port: 6379
password: "J7e411m693cA9"
timeout: 1000
prefix: daop-test
jedis:
pool:
max-idle: 8
max-wait: 2000
min-idle: 0
max-active: 100
test-on-borrow: true
test-while-idle: true
sql:
init:
schema-locations: classpath*:init.sql
encoding: UTF-8
mode: never
redisson:
address: redis://redis-service.daop:6379
password: "J7e411m693cA9"
seata:
enabled: true # 1.0新特性,需要依赖seata-spring-boot-starter,默认为true
tx-service-group: my_test_tx_group
application-id: ms-data-circulation-portal-service
registry:
type: nacos
nacos:
application: seata-server
cluster: seata-cluster
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
password: U9u457p155vH@8
username: nacos
namespace: daop-lt
group: test
service:
vgroupMapping:
my_test_tx_group: seata-cluster
grouplist:
default: ms-daop-seata-service-test:8091
#数据库字段开启驼峰
mybatis:
configuration:
map-underscore-to-camel-case: true
callSettersOnNulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
global-config:
db-config:
id-type: ASSIGN_UUID
logic-delete-value: "null"
logic-not-delete-value: N
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.csbr.qingcloud.configure.mybatis
##生产环境屏蔽此配置 优化性能
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
csbr:
kafka:
topic-prefix: DAOP-LT-TEST
consumer:
# 开启kafka消费者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 是否启用自动提交 offset
enable-auto-commit: false
# 自动提交间隔时间(MS),仅在自动提交开启时有效
auto-commit-interval: 100
# 自动重置 offset。 latest:从最后开始,earliest: 从 offset 为 0 开始
auto-offset-reset: latest
# 消息 key 的反序列化方法
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# 消息 value 的反序列化方法
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# listener 开启的线程数
concurrency: 2
# session 超时时间
session-timeout: 60000
# 最大 poll 消息间隔时间,如果处理时间过长会导致异常
max-poll-interval: 10000
# 最大 poll 消息数量
max-poll-records: 2
producer:
# 开启kafka生产者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,多地址用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 失败后的重发次数
retries: 0
# 一次最多发送的数据量
batch-size: 4096
# 32M批处理缓冲区
buffer-memory: 33554432
# 生产者生产消息间隔,数值越大,间隔越长,用来减缓消费压力
linger: 1
feign:
hystrix:
enabled: false
query-limit:
white: TrTaskValid
spring:
application:
name: ms-data-circulation-portal-service
cloud:
nacos:
#配置中心
config:
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
file-extension: yaml
group: test
namespace: daop-lt
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新(auto-refresh、enable-remote-sync-config两者缺一不可)
auto-refresh: true
# 允许nacos服务端向本地同步配置
enable-remote-sync-config: true
#注册中心
discovery:
enabled: true
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
group: test
namespace: daop-lt
metadata:
code: "006"
user:
name: nacos
password: nacos
management:
context-path: /actuator
#接口限流
sentinel:
transport:
# port: 7777
dashboard: sentinel-service.nacos-cluster:8858
#取消懒加载
eager: true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
###暂时禁用rabbit的健康检查
health:
rabbit:
enabled: false
sentinel:
enabled: false
feign:
sentinel:
enabled: true
\ No newline at end of file
server:
port: 19210
monitor:
log-white:
#服务全局名称
spring:
application:
name: ms-data-circulation-portal-service
jackson:
time-zone: Asia/Shanghai
cloud:
inetutils:
ignored-interfaces: docker0 # 让应用忽略docker0网卡
compatibility-verifier:
enabled: false
gateway:
gatewayServiceName: gateway-server
host: 114.115.131.96
kafka:
bootstrap-servers: kafka-cs-develop.daop:9092
producer:
retries: 3
main:
allow-bean-definition-overriding: true
datasource:
sql-script-encoding: utf-8
#type: org.apache.commons.dbcp2.BasicDataSource
#如果使用TCC事务这个type必须指定,否则会抛出: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;
dynamic:
primary: master
druid:
initial-size: 0
max-active: 50
min-idle: 2
max-wait: -1
min-evictable-idle-time-millis: 30000
max-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 0
validation-query: select 1
validation-query-timeout: -1
test-on-borrow: false
test-on-return: false
test-while-idle: true
pool-prepared-statements: true
# max-open-prepared-statements: 100
filters: stat,wall
share-prepared-statements: true
wall:
config:
condition-double-const-allow: true
condition-and-alway-true-allow: true
##由mycat管理读写分离 不用代码控制(填写mycat的链接库)
datasource:
master:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
slave:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
# redis配置
data:
redis:
# 集群
#cluster:
# nodes: redis-service.redis:6379
# 单节点
host: redis-service.daop
port: 6379
password: "J7e411m693cA9"
timeout: 1000
prefix: daop-release
jedis:
pool:
max-idle: 8
max-wait: 2000
min-idle: 0
max-active: 100
test-on-borrow: true
test-while-idle: true
sql:
init:
schema-locations: classpath*:init.sql
encoding: UTF-8
mode: never
redisson:
address: redis://redis-service.daop:6379
password: "J7e411m693cA9"
seata:
enabled: true # 1.0新特性,需要依赖seata-spring-boot-starter,默认为true
tx-service-group: my_test_tx_group
application-id: ms-data-circulation-portal-service
registry:
type: nacos
nacos:
application: seata-server
cluster: seata-cluster
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
password: U9u457p155vH@8
username: nacos
namespace: daop-master
group: release
service:
vgroupMapping:
my_test_tx_group: seata-cluster
grouplist:
default: ms-daop-seata-service-release:8091
#数据库字段开启驼峰
mybatis:
configuration:
map-underscore-to-camel-case: true
callSettersOnNulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
global-config:
db-config:
id-type: ASSIGN_UUID
logic-delete-value: "null"
logic-not-delete-value: N
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.csbr.qingcloud.configure.mybatis
##生产环境屏蔽此配置 优化性能
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
csbr:
kafka:
topic-prefix: DAOP-RELEASE
consumer:
# 开启kafka消费者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 是否启用自动提交 offset
enable-auto-commit: false
# 自动提交间隔时间(MS),仅在自动提交开启时有效
auto-commit-interval: 100
# 自动重置 offset。 latest:从最后开始,earliest: 从 offset 为 0 开始
auto-offset-reset: latest
# 消息 key 的反序列化方法
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# 消息 value 的反序列化方法
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# listener 开启的线程数
concurrency: 2
# session 超时时间
session-timeout: 60000
# 最大 poll 消息间隔时间,如果处理时间过长会导致异常
max-poll-interval: 10000
# 最大 poll 消息数量
max-poll-records: 2
producer:
# 开启kafka生产者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,多地址用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 失败后的重发次数
retries: 0
# 一次最多发送的数据量
batch-size: 4096
# 32M批处理缓冲区
buffer-memory: 33554432
# 生产者生产消息间隔,数值越大,间隔越长,用来减缓消费压力
linger: 1
feign:
hystrix:
enabled: false
query-limit:
white: TrTaskValid
spring:
application:
name: ms-data-circulation-portal-service
cloud:
nacos:
#配置中心
config:
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
file-extension: yaml
group: release
namespace: daop-master
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新(auto-refresh、enable-remote-sync-config两者缺一不可)
auto-refresh: true
# 允许nacos服务端向本地同步配置
enable-remote-sync-config: true
#注册中心
discovery:
enabled: true
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
group: release
namespace: daop-master
metadata:
code: "006"
user:
name: nacos
password: nacos
management:
context-path: /actuator
#接口限流
sentinel:
transport:
# port: 7777
dashboard: sentinel-service.nacos-cluster:8858
#取消懒加载
eager: true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
###暂时禁用rabbit的健康检查
health:
rabbit:
enabled: false
sentinel:
enabled: false
feign:
sentinel:
enabled: true
\ No newline at end of file
server:
port: 19210
monitor:
log-white:
#服务全局名称
spring:
application:
name: ms-data-circulation-portal-service
jackson:
time-zone: Asia/Shanghai
cloud:
inetutils:
ignored-interfaces: docker0 # 让应用忽略docker0网卡
compatibility-verifier:
enabled: false
gateway:
gatewayServiceName: gateway-server
host: 114.115.131.96
kafka:
bootstrap-servers: kafka-cs-develop.daop:9092
producer:
retries: 3
main:
allow-bean-definition-overriding: true
datasource:
sql-script-encoding: utf-8
#type: org.apache.commons.dbcp2.BasicDataSource
#如果使用TCC事务这个type必须指定,否则会抛出: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection;
dynamic:
primary: master
druid:
initial-size: 0
max-active: 50
min-idle: 2
max-wait: -1
min-evictable-idle-time-millis: 30000
max-evictable-idle-time-millis: 30000
time-between-eviction-runs-millis: 0
validation-query: select 1
validation-query-timeout: -1
test-on-borrow: false
test-on-return: false
test-while-idle: true
pool-prepared-statements: true
# max-open-prepared-statements: 100
filters: stat,wall
share-prepared-statements: true
wall:
config:
condition-double-const-allow: true
condition-and-alway-true-allow: true
##由mycat管理读写分离 不用代码控制(填写mycat的链接库)
datasource:
master:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
slave:
url: jdbc:mysql://192.168.6.21:3307/csbr_data_circulation_portal?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&serverTimezone=Asia/Shanghai&connectTimeout=60000&socketTimeout=60000
username: prg
password: E5t391s349wT@3
driver-class-name: com.mysql.cj.jdbc.Driver
druid:
initial-size: 5
# redis配置
data:
redis:
# 集群
#cluster:
# nodes: redis-service.redis:6379
# 单节点
host: redis-service.daop
port: 6379
password: "J7e411m693cA9"
timeout: 1000
prefix: daop-release
jedis:
pool:
max-idle: 8
max-wait: 2000
min-idle: 0
max-active: 100
test-on-borrow: true
test-while-idle: true
sql:
init:
schema-locations: classpath*:init.sql
encoding: UTF-8
mode: never
redisson:
address: redis://redis-service.daop:6379
password: "J7e411m693cA9"
seata:
enabled: true # 1.0新特性,需要依赖seata-spring-boot-starter,默认为true
tx-service-group: my_test_tx_group
application-id: ms-data-circulation-portal-service
registry:
type: nacos
nacos:
application: seata-server
cluster: seata-cluster
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
password: U9u457p155vH@8
username: nacos
namespace: daop-lt
group: release
service:
vgroupMapping:
my_test_tx_group: seata-cluster
grouplist:
default: ms-daop-seata-service-release:8091
#数据库字段开启驼峰
mybatis:
configuration:
map-underscore-to-camel-case: true
callSettersOnNulls: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus:
global-config:
db-config:
id-type: ASSIGN_UUID
logic-delete-value: "null"
logic-not-delete-value: N
mapper-locations: classpath*:mapper/**/*Mapper.xml
type-aliases-package: com.csbr.qingcloud.configure.mybatis
##生产环境屏蔽此配置 优化性能
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
csbr:
kafka:
topic-prefix: DAOP-LT-RELEASE
consumer:
# 开启kafka消费者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 是否启用自动提交 offset
enable-auto-commit: false
# 自动提交间隔时间(MS),仅在自动提交开启时有效
auto-commit-interval: 100
# 自动重置 offset。 latest:从最后开始,earliest: 从 offset 为 0 开始
auto-offset-reset: latest
# 消息 key 的反序列化方法
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# 消息 value 的反序列化方法
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
# listener 开启的线程数
concurrency: 2
# session 超时时间
session-timeout: 60000
# 最大 poll 消息间隔时间,如果处理时间过长会导致异常
max-poll-interval: 10000
# 最大 poll 消息数量
max-poll-records: 2
producer:
# 开启kafka生产者
enable: true
# kafka 服务集群地址,格式:HOST:PORT ,多地址用逗号隔开
# bootstrap-servers: 210.12.100.201:9092
bootstrap-servers: kafka-cs-develop.daop:9092
# bootstrap-servers: 192.168.3.120:9092
# 失败后的重发次数
retries: 0
# 一次最多发送的数据量
batch-size: 4096
# 32M批处理缓冲区
buffer-memory: 33554432
# 生产者生产消息间隔,数值越大,间隔越长,用来减缓消费压力
linger: 1
feign:
hystrix:
enabled: false
query-limit:
white: TrTaskValid
spring:
application:
name: ms-data-circulation-portal-service
cloud:
nacos:
#配置中心
config:
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
file-extension: yaml
group: release
namespace: daop-lt
# 开启nacos自动刷新,如果这个配置没有或者为false会导致配置不能自动刷新(auto-refresh、enable-remote-sync-config两者缺一不可)
auto-refresh: true
# 允许nacos服务端向本地同步配置
enable-remote-sync-config: true
#注册中心
discovery:
enabled: true
server-addr: nacos-cluster-service-develop.nacos-cluster:8848
group: release
namespace: daop-lt
metadata:
code: "006"
user:
name: nacos
password: nacos
management:
context-path: /actuator
#接口限流
sentinel:
transport:
# port: 7777
dashboard: sentinel-service.nacos-cluster:8858
#取消懒加载
eager: true
management:
endpoint:
health:
show-details: always
endpoints:
web:
exposure:
include: '*'
###暂时禁用rabbit的健康检查
health:
rabbit:
enabled: false
sentinel:
enabled: false
feign:
sentinel:
enabled: true
\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!