基于Apollo官方文档进行apollo和springcloud集成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值