用户工具

站点工具


light4j:config-server
start.yml,configLoaderClass=IConfigLoader,默认DefaultConfigLoader.init,project[Version]+service[Version]
-Dlight-config-server-uri,GET /config-server/configs/{project}/{projectVersion}/{service}/{serviceVersion}
Map<String,Object>=configProperties,put(environment,-Dlight-env),Config.putInConfigCache(values,map)
client.loadTrustStore=false
config_server_authorization=Basic Z3Vlc3Q6MTIzNDU2
config_server_client_truststore_location=H:\nginx-1.16.1\conf\client.truststore
config_server_client_truststore_password=password
  • config:injection使用环境变量+values.yml,-Dlight-4j-config-dir=/light-configs,下载后会覆盖
config.yml,configLoaderClass=ConfigLoader
  • light-config-server:ENV configserver.serviceConfigsDir=light-service-configs java -Dlight-4j-config-dir=.
GetServiceConfigsHandler=/config-server/configs/{project_name}/{project_version}/{service_name}/{service_version}/{environment}
FileSystemProviderImpl:ENV configserver.serviceConfigsDir=绝对路径,或配合-Dlight-4j-config-dir=.指定路径
UrlProviderImpl:-Dconfigserver.serviceConfigsHost=https://git.xlongwei.com指定网址
env client.loadTrustStore=false server.enableHttp=true server.httpPort=8086 server.enableHttps=false
  • IProvider:FileSystemProviderImpl,{light-4j-config-dir}/{configserver.serviceConfigsDir}/**/values.yml
String authToken=provider.login(String authorization) //文件服务不需要登录,ServiceConfigs包含configProperties=Map<String,Object>
ServiceConfigs=getServiceConfigs(authToken,Service) //服务五要素projectName|Version,serviceName|Version,environment
/config-server/,getServiceCertificates获取certs,getServiceFiles获取files,getServiceConfigs获取configs
List<Service>=searchServices(authToken,projectName) //获取所有服务

  • UrlProviderImpl、UrlConfigLoader、GitConfigLoader

light4j/config-server.txt · 最后更改: 2021/05/08 10:46 由 admin