https://ctripcorp.github.io/apollo/#/zh/development/apollo-development-guide?id=_234-vm-options%e9%85%8d%e7%bd%ae
根据apollo的官方文档
1、可以用自带的快速运行进行部署
https://ctripcorp.github.io/apollo/#/zh/deployment/quick-start
1.3 下载Quick Start安装包
2.1 创建数据库
2.2 配置数据库连接信息
3.2 执行启动脚本
2、用其源代码在idea中运行
本地启动
2.1 Apollo Config Service和Apollo Admin Service
1、新建运行配置
对
com.ctrip.framework.apollo.assembly.ApolloApplication
进行配置
2、 Apollo-Portal
对com.ctrip.framework.apollo.portal.PortalApplication
进行配置
至此apollo本地已经启动
3、用自带的demo进行学习模仿在自己的项目中
Demo应用接入
SpringBootSampleApplication
在自己的项目中的使用:
apollo设置
apollo:
bootstrap:
enabled: true
meta: http://localhost:8080
app:
id: test
然后可以用注释方式或者其它方式都可:
@Data
@Configuration
public class TestConf {
@Value("${timeout: 10}")
private int timeout;
}
3、后续
后续还需要部署在生产环境的话,还需要在第2部idea中修改运行,比如端口就需要改。
https://ctripcorp.github.io/apollo/#/zh/deployment/distributed-deployment-guide