地址:https://www.bilibili.com/video/BV1qt4117789?from=search&seid=7136366595002330347

部署地址:

Apollo配置中心设置

201是portal

202是dev

203是pro

---

数据库:

Apollo配置中心设置

数据库:

Apollo配置中心设置

---

修改配置文件:

其中configbd就是跑在202和203上。

portaldb是在201上面的。

---

看是开发还是生产环境的:

Apollo配置中心设置

---

其中202和203跑这个:

Apollo配置中心设置

201跑这个:

Apollo配置中心设置

---

修改portal的配置文件:

Apollo配置中心设置

修改数据库配置文件

Apollo配置中心设置

修改数据库添加环境:

Apollo配置中心设置

---

修改202和203:

Apollo配置中心设置

Apollo配置中心设置

---

Apollo配置中心设置

---

启动:

Apollo配置中心设置

创建项目详情:

Apollo配置中心设置

----------------------03------------------------

Apollo配置中心设置

如何使用?

开发环境新增配置:

Apollo配置中心设置

Apollo配置中心设置

Apollo配置中心设置

客户端:

第一步,在配置文件配置app.id:

Apollo配置中心设置

第二步,添加jar包依赖。

第三步,

Apollo配置中心设置

其他配置,命名空间默认是application

Apollo配置中心设置

第四步:配置apollo.meta

Apollo配置中心设置

---

注入到bean里面:

第一步新建命名空间:

Apollo配置中心设置

Apollo配置中心设置

第二步:

Apollo配置中心设置

添加配置:

Apollo配置中心设置

第三步:在应用程序测试,目前跑的就是开发环境:

Apollo配置中心设置

此时命名空间换了,如何设置?

Apollo配置中心设置

---

注入bean:

第一步:

Apollo配置中心设置

config配置:

Apollo配置中心设置

拼接:

Apollo配置中心设置

第二步:bean要加刷新注解的:

Apollo配置中心设置

添加类:

Apollo配置中心设置

最终配置类的版本:Apollo配置中心设置

---

灰度发布:暂时不看了

--------------------04----------------------------

相关文章: