refactor(deploy): 迁移CI/CD至双服务器架构
- Jenkinsfile: Registry改为Infra内网172.17.16.7:5000,部署目标改为Prod内网172.17.16.14 - docker-compose: 镜像源改为172.17.16.7:5000,MySQL改为172.17.16.8,Redis改为172.17.16.13,RocketMQ改为腾讯云TDMQ - 所有模块application-prod.yaml: 统一更新MySQL/Redis/RocketMQ默认连接地址 - deploy.sh: Registry地址同步更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,156 +1,156 @@
|
||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_ADDR:127.0.0.1:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_DISCOVERY_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
config:
|
||||
namespace: ${NACOS_CONFIG_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
file-extension: yaml
|
||||
refresh-enabled: true
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
login-username: ${DRUID_USERNAME:admin}
|
||||
login-password: ${DRUID_PASSWORD:admin}
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic:
|
||||
druid:
|
||||
initial-size: 5
|
||||
min-idle: 10
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 600000
|
||||
max-evictable-idle-time-millis: 1800000
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://${MYSQL_HOST:127.0.0.1}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:aiot_platform}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PASSWORD:}
|
||||
slave:
|
||||
lazy: true
|
||||
url: jdbc:mysql://${MYSQL_SLAVE_HOST:${MYSQL_HOST:127.0.0.1}}:${MYSQL_SLAVE_PORT:${MYSQL_PORT:3306}}/${MYSQL_DATABASE:aiot_platform}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: ${MYSQL_SLAVE_USER:${MYSQL_USER:root}}
|
||||
password: ${MYSQL_SLAVE_PASSWORD:${MYSQL_PASSWORD:}}
|
||||
tdengine:
|
||||
url: jdbc:TAOS-RS://${TDENGINE_HOST:172.17.16.14}:${TDENGINE_PORT:6041}/aiot_platform
|
||||
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
|
||||
username: ${TDENGINE_USERNAME:root}
|
||||
password: ${TDENGINE_PASSWORD:taosdata}
|
||||
druid:
|
||||
validation-query: SELECT SERVER_STATUS()
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
password: ${REDIS_PASSWORD:}
|
||||
timeout: 5000ms
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: -1ms
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
rocketmq:
|
||||
name-server: ${ROCKETMQ_NAMESRV_ADDR:127.0.0.1:9876}
|
||||
|
||||
spring:
|
||||
# 禁用 RabbitMQ 自动配置(如果不需要 RabbitMQ,避免启动时连接失败)
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
|
||||
# RabbitMQ 配置(已禁用自动配置,仅保留配置项供业务代码使用)
|
||||
# rabbitmq:
|
||||
# host: ${RABBITMQ_HOST:127.0.0.1}
|
||||
# port: ${RABBITMQ_PORT:5672}
|
||||
# username: ${RABBITMQ_USERNAME:guest}
|
||||
# password: ${RABBITMQ_PASSWORD:guest}
|
||||
kafka:
|
||||
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:127.0.0.1:9092}
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: ${XXL_JOB_ADMIN_ADDRESSES:http://172.17.16.14:19090/xxl-job-admin}
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
lock4j:
|
||||
acquire-timeout: 3000
|
||||
expire: 30000
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
include: '*'
|
||||
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ${SPRING_BOOT_ADMIN_USERNAME:admin}
|
||||
password: ${SPRING_BOOT_ADMIN_PASSWORD:admin}
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.viewsh: ${LOG_LEVEL:INFO}
|
||||
com.viewsh.module.iot.dal.mysql: debug
|
||||
com.viewsh.module.iot.dal.mysql.sms.SmsChannelMapper: INFO
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR
|
||||
file:
|
||||
name: ${LOG_FILE_PATH:/app/logs}/${spring.application.name}.log
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
viewsh:
|
||||
demo: false
|
||||
env:
|
||||
tag: ${HOSTNAME:prod}
|
||||
captcha:
|
||||
enable: true
|
||||
security:
|
||||
mock-enable: false
|
||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: ${NACOS_ADDR:127.0.0.1:8848}
|
||||
username: ${NACOS_USERNAME:nacos}
|
||||
password: ${NACOS_PASSWORD:nacos}
|
||||
discovery:
|
||||
namespace: ${NACOS_DISCOVERY_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0
|
||||
config:
|
||||
namespace: ${NACOS_CONFIG_NAMESPACE:prod}
|
||||
group: DEFAULT_GROUP
|
||||
file-extension: yaml
|
||||
refresh-enabled: true
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
login-username: ${DRUID_USERNAME:admin}
|
||||
login-password: ${DRUID_PASSWORD:admin}
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 100
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
dynamic:
|
||||
druid:
|
||||
initial-size: 5
|
||||
min-idle: 10
|
||||
max-active: 20
|
||||
max-wait: 60000
|
||||
time-between-eviction-runs-millis: 60000
|
||||
min-evictable-idle-time-millis: 600000
|
||||
max-evictable-idle-time-millis: 1800000
|
||||
validation-query: SELECT 1 FROM DUAL
|
||||
test-while-idle: true
|
||||
test-on-borrow: false
|
||||
test-on-return: false
|
||||
pool-prepared-statements: true
|
||||
max-pool-prepared-statement-per-connection-size: 20
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://${MYSQL_HOST:172.17.16.8}:${MYSQL_PORT:3306}/${MYSQL_DATABASE:aiot-platform-test}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: ${MYSQL_USER:root}
|
||||
password: ${MYSQL_PASSWORD:}
|
||||
slave:
|
||||
lazy: true
|
||||
url: jdbc:mysql://${MYSQL_SLAVE_HOST:${MYSQL_HOST:172.17.16.8}}:${MYSQL_SLAVE_PORT:${MYSQL_PORT:3306}}/${MYSQL_DATABASE:aiot-platform-test}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: ${MYSQL_SLAVE_USER:${MYSQL_USER:root}}
|
||||
password: ${MYSQL_SLAVE_PASSWORD:${MYSQL_PASSWORD:}}
|
||||
tdengine:
|
||||
url: jdbc:TAOS-RS://${TDENGINE_HOST:172.17.16.14}:${TDENGINE_PORT:6041}/aiot_platform
|
||||
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
|
||||
username: ${TDENGINE_USERNAME:root}
|
||||
password: ${TDENGINE_PASSWORD:taosdata}
|
||||
druid:
|
||||
validation-query: SELECT SERVER_STATUS()
|
||||
|
||||
data:
|
||||
redis:
|
||||
host: ${REDIS_HOST:172.17.16.13}
|
||||
port: ${REDIS_PORT:6379}
|
||||
database: ${REDIS_DATABASE:0}
|
||||
password: ${REDIS_PASSWORD:}
|
||||
timeout: 5000ms
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-wait: -1ms
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
rocketmq:
|
||||
name-server: ${ROCKETMQ_NAMESRV_ADDR:rmq-4wd73bxpv.rocketmq.sh.qcloud.tencenttdmq.com:8080}
|
||||
|
||||
spring:
|
||||
# 禁用 RabbitMQ 自动配置(如果不需要 RabbitMQ,避免启动时连接失败)
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration
|
||||
# RabbitMQ 配置(已禁用自动配置,仅保留配置项供业务代码使用)
|
||||
# rabbitmq:
|
||||
# host: ${RABBITMQ_HOST:127.0.0.1}
|
||||
# port: ${RABBITMQ_PORT:5672}
|
||||
# username: ${RABBITMQ_USERNAME:guest}
|
||||
# password: ${RABBITMQ_PASSWORD:guest}
|
||||
kafka:
|
||||
bootstrap-servers: ${KAFKA_BOOTSTRAP_SERVERS:127.0.0.1:9092}
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
xxl:
|
||||
job:
|
||||
admin:
|
||||
addresses: ${XXL_JOB_ADMIN_ADDRESSES:http://172.17.16.14:19090/xxl-job-admin}
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
lock4j:
|
||||
acquire-timeout: 3000
|
||||
expire: 30000
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
base-path: /actuator
|
||||
exposure:
|
||||
include: '*'
|
||||
|
||||
spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
instance:
|
||||
service-host-type: IP
|
||||
username: ${SPRING_BOOT_ADMIN_USERNAME:admin}
|
||||
password: ${SPRING_BOOT_ADMIN_PASSWORD:admin}
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
com.viewsh: ${LOG_LEVEL:INFO}
|
||||
com.viewsh.module.iot.dal.mysql: debug
|
||||
com.viewsh.module.iot.dal.mysql.sms.SmsChannelMapper: INFO
|
||||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR
|
||||
file:
|
||||
name: ${LOG_FILE_PATH:/app/logs}/${spring.application.name}.log
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
viewsh:
|
||||
demo: false
|
||||
env:
|
||||
tag: ${HOSTNAME:prod}
|
||||
captcha:
|
||||
enable: true
|
||||
security:
|
||||
mock-enable: false
|
||||
|
||||
Reference in New Issue
Block a user