Apollo(三)-调试环境搭建

x33g5p2x  于2021-12-20 转载在 其他  
字(1.0k)|赞(0)|评价(0)|浏览(287)

前提

本地Win10上已安装Jdk1.8、Mysql、Navicat、Idea;

源码

下载

apollo-master.zip

解压

D:\YDSource\apollo-master

Idea导入项目(Maven工程)

数据库用户名和密码:root/123456

配置

新建三个Application启动项

ApolloApplication

-Dapollo_profile=github
-Dspring.datasource.url=jdbc:mysql://localhost:3306/apolloconfigdb?characterEncoding=utf8
-Dspring.datasource.username=root
-Dspring.datasource.password=123456
-Dlogging.file=D://apollo-assembly.log
--configservice --adminservice

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=root
-Dspring.datasource.password=123456
-Dlogging.file=D://apollo-portal.log

SimpleApolloConfigDemo

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

运行

启动AplloApplication

访问eureka地址:http://localhost:8080/
可以看到adminservice、configservice都启动了:

启动PortalApplication

访问http://localhost:8070,结果如下

启动SimpleApolloConfigDemo

输入name后显示没有该值,如下所示:

修改变量值

在apollo中建立id为100004458的项目:

新增name的配置,并发布

发布的配置成功了

相关文章