# spring-boot-apollo **Repository Path**: it-sunweicheng/spring-boot-apollo ## Basic Information - **Project Name**: spring-boot-apollo - **Description**: SpringBoot整合Apollo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-26 - **Last Updated**: 2024-05-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: apollo ## README # SpringBoot整合Apollo ### 环境 SpringBoot版本:2.7.15 Apollo服务器版本:1.7.1 | 2.1.0 ### Apollo下载与安装 下载地址:https://github.com/apolloconfig/apollo-quick-start ### Apollo Windows系统运行指南 1 解压压缩文件并执行apolloportaldb.sql和apolloconfigdb.sql。 2 修改demo.sh关于数据库相关配置,如下: 高版本 apollo_config_db_url=${APOLLO_CONFIG_DB_URL:-"jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai"} apollo_config_db_username=root apollo_config_db_password=password apollo_portal_db_url=${APOLLO_PORTAL_DB_URL:-"jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai"} apollo_portal_db_username=root apollo_portal_db_password=password 低版本 apollo_config_db_url="jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai" apollo_config_db_username=root apollo_config_db_password=password apollo_portal_db_url="jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai" apollo_portal_db_username=root apollo_portal_db_password=password 3 打开Git Bash窗口(需要安装Git),运行./demo.sh start启动服务。 4 打开Git Bash窗口(需要安装Git),运行./demo.sh stop关闭服务。 注:Windows系统先Git,建议使用最新版本,老版本可能会遇到未知错误。 ### Apollo配置 1 登陆地址:http://localhost:8070 账号/密码:admin/admin 2 创建项目,信息如下: 部门:样式部门1(TEST1) AppId:apollo-test 应用名称:测试 应用负责人:apollo | apollo 项目管理员:apollo | apollo 3 添加Namespace:test-prop、test-yml、test-yaml、test-json、test-xml 4 添加配置,配置参考example.txt文件。 ### 优先级 阿波罗application.properties > 阿波罗xxx.properties > 阿波罗xxx.yml > 本地application.properties > 本地application.yml > 默认 ### 常见报错 报错信息:Unknown column 'serverconf0_.DeletedAt' in 'field list' 解决方案:重新执行sql,重启服务。 ### 注意事项 读取yml或yaml配置时,项目依赖的snakeyaml版本必须低于2.0(不包含),否则无法解析yml类型配置! ## 参考 - Apollo官网文档:https://www.apolloconfig.com/#/zh/README - Apollo Github官网地址:https://github.com/apolloconfig/apollo - Apollo官方下载地址:https://github.com/apolloconfig/apollo/releases - Apollo本地快速部署下载地址:https://github.com/apolloconfig/apollo-quick-start - Apollo服务启动指南:https://www.apolloconfig.com/#/zh/deployment/quick-start