Spring Boot项目整合Apollo错误:for env UNKNOWN from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider

Apollo支持完善的管理界面,支持多环境,配置变更实时生效,权限和配置审计等多种生产级功能

错误信息

1
2
3
4
App ID is set to appblog-gateway by app.id property from System Property
Environment is set to null. Because it is not available in either (1) JVM system property 'env', (2) OS env variable 'ENV' nor (3) property 'env' from the properties InputStream.
Located meta services from apollo.meta configuration: http://192.168.1.20:8980!
Located meta server address http://192.168.1.20:8980 for env UNKNOWN from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider

解决方案

启动项目时修改配置

1
-Denv=DEV

-Denv就是开发环境,DEV表示Apollo配置中的环境名称

IDEA配置:Edit Run/Debug Configurations -> Configuration -> VM options 配置 -Denv=DEV

Linux服务器启动jar 也需要加上启动参数,例如:java -Denv=DEV -jar appblog.jar

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :