电光石火-穿越时空电光石火-穿越时空


apollo本地启动

使用apollo最新的1.1版本:https://github.com/ctripcorp/apollo
导入idea设置启动配置

TIM截图20181008130028.jpg

1.新建ConfigAdminService

主要类:

com.ctrip.framework.apollo.assembly.ApolloApplication

虚拟机选项:

-Dapollo_profile=github
-Dspring.datasource.url=jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8
-Dspring.datasource.username=apollo
-Dspring.datasource.password=
-Dlogging.file=D:/app/apollo-assembly.log

程序参数:

--configservice --adminservice

使用模块的类路径apollo-assembly


2.新建PortalService

主要类:

com.ctrip.framework.apollo.portal.PortalApplication

虚拟机选项:

-Dapollo_profile=github,auth
-Ddev_meta=http://localhost:8080/
-Dserver.port=8070
-Dspring.datasource.url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8
-Dspring.datasource.username=apollo
-Dspring.datasource.password=
-Dlogging.file=D:/app/apollo-portal.log

使用模块的类路径apollo-portal


3.新建Demo

主要类:

com.ctrip.framework.apollo.demo.api.SimpleApolloConfigDemo

虚拟机选项:

-Denv=dev -Ddev_meta=http://localhost:8080

使用模块的类路径apollo-demo


按顺序启动,访问127.0.0.1:8080查看3个服务是否注册成功
访问127.0.0.1:8070 默认账号密码apollo/admin
新建应用100004458,添加配置key:timeout value:255

TIM截图20181008133813.jpg

在demo运行框内输入timeout回车后暂无显示
点击网页上的发布,再在demo中输入timeout回车后显示255

本博客所有文章如无特别注明均为原创。作者:似水的流年
版权所有:《电光石火-穿越时空》 => apollo本地启动
本文地址:http://www.ilkhome.cn/index.php/archives/410/
欢迎转载!复制或转载请以超链接形式注明,文章为 似水的流年 原创,并注明原文地址 apollo本地启动,谢谢。

评论