Apollo-本地开发环境搭建

1. 准备工作

  • JDK8+
  • MySQL: 5.6.5+
  • IDE: IDEA
  • 下载源码:https://github.com/apolloconfig/apollo

2. 创建数据库

脚本在源代码scripts,包括apolloconfigdb.sql、apolloportaldb.sql。
在这里插入图片描述
执行之后,创建了两个数据库。
在这里插入图片描述

3. 搭建admin service 和 config service

3.1 配置

admin service和config service,这两个服务可以同时启动。
找到工程:apollo-assembly。

  • 启动类:com.ctrip.framework.apollo.assembly.ApolloApplication
  • JVM配置:
-Dapollo_profile=github
-Dspring_datasource_url=jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=GMT%2B8
-Dspring_datasource_username=root
-Dspring_datasource_password=258369
-Dlogging.file.name=E:/12_learning/apollo/apollo-log/apollo-assembly.log
  • 程序参数:
--configservice --adminservice

在这里插入图片描述

3.2 验证

启动之后,访问:http://localhost:8080/
在这里插入图片描述

4. 搭建portal

4.1 配置

  • 启动类:com.ctrip.framework.apollo.portal.PortalApplication
  • JVM配置:
-Dapollo_profile=github,auth
-Ddev_meta=http://localhost:8080/
-Dspring_datasource_url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=GMT%2B8
-Dspring_datasource_username=root
-Dspring_datasource_password=258369
-Dlogging.file.name=E:/12_learning/apollo/apollo-log/apollo-portal.log

在这里插入图片描述

4.2 验证

启动之后,登录:http://localhost:8070/
账号密码:apollo/admin

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值