apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
29.06k stars 10.2k forks source link

服务发现配置问题解惑 #2843

Closed sunnoy closed 4 years ago

sunnoy commented 4 years ago

分布式部署中的configserver服务发现地址

helm部署中的参数

运行参数中

# 通过配置环境变量
        - name: eureka.service.url
          value: http://apollo-devconfigservice:8080/eureka/

数据库中

INSERT INTO `ServerConfig` (`Key`, `Cluster`, `Value`, `Comment`)      VALUES          ('eureka.service.url', 'default', 'http://apollo-devconfigservice:8080/eureka/', 'Eureka服务Url,多个service以英文逗号分隔'),

疑问的地方

一个服务有两个配置eureka的地方是不是重复了呢?或者说Apollo默认是从数据库里面读取,通过环境变量的方式来加入根本就用不到,望解答!

nobodyiam commented 4 years ago

优先从环境变量读,其次从数据读,可以debug一下com.ctrip.framework.apollo.biz.config.BizConfig#eurekaServiceUrls

sunnoy commented 4 years ago

谢谢解惑