本地环境无法连接公网Apollo
为了学习方便,在公网上搭建了一套携程Apollo配置中心,环境搭建好后发现本地连不上公网的Apollo,日志发现一直连接公网私有ip,折腾了半天最后发现找到解决办法。
1.客户端版本需要在0.11.0版本以上,如下maven
<!-- springBoot 整合apollo-->
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
<version>1.0.0</version>
</dependency>
2.通过配置idea启动
-Dapollo.configService=http:xxx.xxx.xxx.xxx
完美解决问题。