1 配置说明
- 此处调整配置分为:必要公共配置、通用公共配置、项目独有配置
- 除了必要公共配置是私有不可见,其他均为公开配置,可以引入覆盖
- 配置优先级为:环境变量>环境变量apollo.app.namespaces配置>低代码内置配置
- 修改配置可以通过apollo.app.namespaces填入私有的配置
- 也可以通过引入公共配置覆盖
1.1 必要公共配置
此处为所有服务公用的安全要求高的配置:数据库、Redis配置等
spring.datasource.url = jdbc:postgresql://pgtest002.gz.cvte.cn:5432/xxxx?&ssl=false
spring.datasource.username = clcp
spring.datasource.password = xxxxxxx
spring.datasource.driver-class-name = org.postgresql.Driver
spring.redis.host = redis-test003.gz.cvte.cn
spring.redis.port = 6379
spring.redis.password = xxxxxxxxx
spring.redis.database = 12345
1.2 可能需要修改的公共配置
# 如果多套低代码公用Redis则需要修改此处配置
csb.redis.keyPrefix = lcp.hub
# 如果与标准不一致需要修改,例如fat实际上是sit的话需要修改,默认与环境保持一致
eureka.client.serviceUrl.defaultZone = https://eureka-fat1.gz.cvte.cn/eureka/,https://eureka-fat2.gz.cvte.cn/eureka/
# 建议修改
csb.iac.appId = 2a1fe9c4-4f65-419c-bd4e-xxxxx
csb.iac.appSecret = 836f4178-bbf6-47ba-905d-xxxxx
csb.iac.systemId = f03853eb-c694-4cf3-854f-xxxxx
csb.iac.tenantId = c518f53d-b405-4111-afe1-xxxxxx
# 默认租户和应用ID配置,如果无多租户不用配置,一般不用配置
lcp.default.tenantId = c518f53d-b405-4111-afe1-xxxxx
lcp.default.apptId = 2a1fe9c4-4f65-419c-bd4e-xxxxx
# 环境同步密码,建议修改
sync.encryptePwd = sync
# 必须修改每个项目的服务名,带上产品域特性
lcp.hub.application.name = lcp-hub
lcp.app.application.name = lcp-app
lcp.data.application.name = lcp-data
csb.legox.application.name = CSB-LEGOX/legox
# datart服务,如果未部署不用改
lcp.dataview.application.name = lcp-dataview
# MQ配置,可以切换自己的也可以使用默认的,使用默认则此次不改
#只需要改itemtoes.queue.name带上产品域特性
spring.rabbitmq.url = rmq-test.gz.cvte.cn:5672
spring.rabbitmq.username = clcp
spring.rabbitmq.password = xxxxxx
spring.rabbitmq.virtualHost = /clcp
spring.rabbitmq.listener.retry.enabled = true
spring.rabbitmq.host = rmq-test.gz.cvte.cn
spring.rabbitmq.port = 5672
spring.rabbitmq.publisherConfirms = true
# 上面配置不改则改此处
itemtoes.queue.name = lcpSearchPushItemToEsQueue
# 域名配置需要修改
lcp.core.url = https://lcptest.gz.cvte.cn/app
lcp.data.url = https://lcptest.gz.cvte.cn/data
lcp.hub.url = https://lcptest.gz.cvte.cn/hub
service.csb.url = https://csbtest-admin.gz.cvte.cn/legox
service.csb.gw.url = https://csbtest-gw.gz.cvte.cn
# 如果使用公共的可以不需要修改
service.csno.url = https://csbtest-api.gz.cvte.cn/csno
service.file.url = https://csbtest-api.gz.cvte.cn/cfile
csb.wfp.url = https://csbtest-api.gz.cvte.cn/wfp-api
1.3 应用独有配置
1.3.1 lcp-hub 平台服务配置
# 如果csb视图密码加密密钥一样则不用处理
view.database.encryptKey = XXXXX
1.3.2 lcp-app 应用服务配置
# OA工作流系统ID
csb.wfp.sysId = TZ-LCP
# 邮箱配置信息
clcp.msg.caller = CSB
clcp.msg.sender = 天舟云低代码平台<csb@cvte.io>
clcp.msg.env = FAT
# 异常通知处理人
wf.notice.email = niewei@cvte.com
# 如果都是csb.legox.application.name配置同则不用配置
csb.dictionary.feignName = ${csb.legox.application.name}
csb.feignName = ${csb.legox.application.name}
csb.serial.feignName = ${csb.legox.application.name}
csb.base.feignName = ${csb.legox.application.name}
csb.userRole.feignName = ${csb.legox.application.name}
csb.org.feignName = ${csb.legox.application.name}
1.3.3 lcp-data 数据服务配置
暂时没有需调整配置项
2 配置方式
配置方式可以有两种
- 可以使用私有配置或环境变量利用优先级覆盖低代码配置
- 可以通过Apollo配置中心关联公共配置进行覆盖操作
2.1 私有配置覆盖
在环境变量中apollo.app.namespaces配置的优先级更高,此方式需要在配置
2.2 关联公共配置覆盖
此方式无需额外配置,直接生效,发布后重启应用即可
可以选择性覆盖配置
3 示例说明
推荐使用独有配置使用私有配置,其他通过关联公共配置覆盖的方式
3.1 私有配置
spring.datasource.url = jdbc:postgresql://pgtest002.gz.cvte.cn:5432/xxxx?&ssl=false
spring.datasource.username = clcp
spring.datasource.password = xxxxxxx
spring.datasource.driver-class-name = org.postgresql.Driver
spring.redis.host = redis-test003.gz.cvte.cn
spring.redis.port = 6379
spring.redis.password = xxxxxxxxx
spring.redis.database = 12345
csb.iac.appId = 2a1fe9c4-4f65-419c-bd4e-xxxxx
csb.iac.appSecret = 836f4178-bbf6-47ba-905d-xxxxx
csb.iac.systemId = f03853eb-c694-4cf3-854f-xxxx
csb.iac.tenantId = c518f53d-b405-4111-afe1-xxxxx
lcp.hub.application.name = xx-lcp-hub
lcp.app.application.name = xx-lcp-app
lcp.data.application.name = xx-lcp-data
csb.legox.application.name = xx-CSB-LEGOX/legox
itemtoes.queue.name = xx-lcpSearchPushItemToEsQueue
lcp.core.url = https://lcptest.gz.cvte.cn/app
lcp.data.url = https://lcptest.gz.cvte.cn/data
lcp.hub.url = https://lcptest.gz.cvte.cn/hub
service.csb.url = https://csbtest-admin.gz.cvte.cn/legox
service.csb.gw.url = https://csbtest-gw.gz.cvte.cn
# 如果使用公共的可以不需要修改,以下两个配置是一起配套的
service.csno.url = https://csbtest-api.gz.cvte.cn/csno
csb.serial.feignName = ${csb.legox.application.name}
3.2 关联配置
以lcp-app的配置为例
4 实际落地
4.1 配置文件
以供应链为例,仅需要配置一个配置文件即可,三个服务都只需要配置这一份配置即可
# 数据库配置
spring.datasource.url = jdbc:postgresql://t-dbsec-postgres.gz.cvte.cn:11000/pguat_scm
spring.datasource.username = scm
spring.datasource.password = XXXXXX
spring.datasource.driver-class-name = org.postgresql.Driver
#Redis连接
spring.redis.host = redis-fat001.gz.cvte.cn
spring.redis.password = XXXXX
spring.redis.port = 6379
spring.redis.database = 9
# IAC配置
csb.iac.appId = 15d22276-a397-4f24-bcea-XXXXXX
csb.iac.appSecret = d96deb81-358e-481b-XXXXXX
csb.iac.systemId = 1206b5b9-1c37-45c6-8ed0-XXXXX
csb.iac.tenantId = 93caaf4e-478e-4026-a87d-XXXXXXX
# 服务名
lcp.hub.application.name = scm-lcp-hub
lcp.app.application.name = scm-lcp-app
lcp.data.application.name = scm-lcp-data
csb.legox.application.name = scm-bsm
# 流水号使用公共的
csb.serial.feignName = csb-legox/legox
# 队列,使用低代码的MQ使用不同的队列
itemtoes.queue.name = scm-lcpSearchPushItemToEsQueue
#域名配置
lcp.core.url = https://scm-buat-api.gz.cvte.cn/app
lcp.data.url = https://scm-buat-api.gz.cvte.cn/data
lcp.hub.url = https://scm-buat-api.gz.cvte.cn/hub
# bsm csb legox后台访问地址
service.csb.url = https://scm-buat-api.gz.cvte.cn
service.csb.gw.url = https://csbuat-gw.gz.cvte.cn
#流水号地址,如果需要使用自己的需要修改
service.csno.url = https://csbtest-api.gz.cvte.cn/csno
4.2 鲸云应用环境变量配置
仅配置Apollo相关配置即可
作者:聂维 创建时间:2023-04-20 16:27
最后编辑:聂维 更新时间:2024-12-11 10:09
最后编辑:聂维 更新时间:2024-12-11 10:09