apollo源码启动服务,apollo源码分析

1.下载APOLLO源码

https://gitee.com/nobodyiam/apollo

2.执行Sql脚本

在这里插入图片描述

3.启动项目

编译项目后

3.1 启动ConfigServiceApplication

-Denv=dev
-Dspring.profiles.active=github
-Deureka.service.url=http://localhost:8080/eureka/
-Dspring.datasource.url=jdbc:mysql://localhost:3306/apolloconfigdb?characterEncoding=utf8&serverTimezone=Asia/Shanghai
-Dspring.datasource.username=root
-Dspring.datasource.password=123456
-Dlogging.file=D:/logs/apollo-assembly.log

在这里插入图片描述

3.2 启动apollo-assembly

VM

-Denv=dev
-Dspring.profiles.active=github
-Deureka.service.url=http://localhost:8080/eureka/
-Dspring.datasource.url=jdbc:mysql://localhost:3306/apolloconfigdb?characterEncoding=utf8&serverTimezone=Asia/Shanghai
-Dspring.datasource.username=root
-Dspring.datasource.password=123456
-Dlogging.file=D:/logs/apollo-assembly.log

Program arguments

–configservice --adminservice

在这里插入图片描述

3.3 启动 apollo-portal

VM

-Denv=dev
-Ddev_meta=http://localhost:8080
-Dhibernate.query.plan_cache_max_size=192
-Dspring.datasource.url=jdbc:mysql://localhost:3306/apolloportaldb?characterEncoding=utf8&serverTimezone=Asia/Shanghai
-Dspring.datasource.username=root
-Dspring.datasource.password=123456
-Dlogging.file=D:/logsh/apollo-portal.log

Program arguments

–portal

在这里插入图片描述

增加apollo-portal 下的application.yml中增加配置

spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect

在这里插入图片描述

有可能遇到数据库连接问题:
Data source rejected establishment of connection, message from server: “Too many connections”

修改mysql下的my.ini文件

# 允许最大连接数
max_connections=1000
# max_user_connections设置每用户最大连接数为500
max_user_connections=500
# wait_timeout表示200秒后将关闭空闲(IDLE)的连接,但是对正在工作的连接不影响。
wait_timeout=200

在这里插入图片描述
然后重启mysql服务 net stop mysql,net start mysql

4.打开apollo控制台

http://localhost:8070
用户名:apollo
密码:admin

在这里插入图片描述

5.源码分析

这边简单易懂
https://cloud.tencent.com/developer/article/1964636

参考:
https://gitee.com/nobodyiam/apollo/wikis/Quick-Start
https://blog.csdn.net/yang1076180972/article/details/121058159?ops_request_misc=&request_id=&biz_id=102&utm_term=apollo%E9%85%8D%E7%BD%AE%E4%B8%AD%E5%BF%83%E6%BA%90%E7%A0%81%E5%90%AF%E5%8A%A8&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-0-121058159.142v35pc_rank_34&spm=1018.2226.3001.4187

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值