从零开始的Linux运维屌丝之路,资源免费分享平台   运维人员首选:简单、易用、高效、安全、稳定、社区活跃的开源软件

Apollo搭建文档

发布:蔺要红09-19分类: 运维

# 阿里巴巴配置中心
https://github.com/alibaba/nacos
# apollo配置中心
https://github.com/ctripcorp/apollo/releases
 
# 使用说明
https://github.com/ctripcorp/apollo/wiki
#php接入
https://github.com/multilinguals/apollo-php-client
# 项目地址
https://github.com/ctripcorp/apollo/releases
# 下载地址
# 每个环境节点都需要安装
wget https://github.com/ctripcorp/apollo/releases/download/v1.7.0/apollo-adminservice-1.7.0-github.zip
wget https://github.com/ctripcorp/apollo/releases/download/v1.7.0/apollo-configservice-1.7.0-github.zip
# 主控安装
wget https://github.com/ctripcorp/apollo/releases/download/v1.7.0/apollo-portal-1.7.0-github.zip

# SQL 
https://raw.githubusercontent.com/ctripcorp/apollo/v1.7.0/scripts/sql/apolloconfigdb.sql
https://raw.githubusercontent.com/ctripcorp/apollo/v1.7.0/scripts/sql/apolloportaldb.sql

# 服务端口说明
apollo-configservice  8080
apollo-adminservice   8090
apollo-portal         8070
# 修改配置文件 
# prod环境(其他环境同理) apollo-adminservice-1.6.0  的配置文件
spring.datasource.url = jdbc:mysql://10.66.110.108:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = apollo
spring.datasource.password = IrCrRAzmrJYXr&yA
# ApolloConfigDB 配置文件修改
spring.datasource.url = jdbc:mysql://10.66.110.108:3306/ApolloConfigDB?characterEncoding=utf8
spring.datasource.username = apollo
spring.datasource.password = IrCrRAzmrJYXr&yA
# 这两行可以不用配置,为 系统信息 Instance Info 和 eureka 显示和调用使用的地址
eureka.instance.ip-address=prod-apollo.vipthink.cn
eureka.instance.homePageUrl=http://prod-apollo.vipthink.cn
# ApolloPorta 配置文件修改
spring.datasource.url = jdbc:mysql://10.66.110.108:3306/ApolloPortalDB?characterEncoding=utf8
spring.datasource.username = apollo
spring.datasource.password = IrCrRAzmrJYXr&yA
# cat apollo-env.properties
dev.meta=http://10.104.27.12:8088
uat.meta=http://10.104.57.153:8088
prod.meta=http://10.104.27.171:8088

# 重启脚本
cat >restart.sh <<-'EOF'
#!/bin/sh
/data/apollo-1.7/apollo-adminservice/scripts/shutdown.sh
/data/apollo-1.7/apollo-configservice/scripts/shutdown.sh
/data/apollo-1.7/apollo-portal/scripts/shutdown.sh
sleep 10
/data/apollo-1.7/apollo-configservice/scripts/startup.sh
/data/apollo-1.7/apollo-adminservice/scripts/startup.sh
/data/apollo-1.7/apollo-portal/scripts/startup.sh

EOF
chmod +x restart.sh 

# 其他注意事项 ApolloConfigDB 如果要修改端口/除了在启动脚本里修改端口外,还需要修改数据库相关配置/双节点更需要修改

表:ServerConfig > eureka.service.url > http://10.4.48.12:8088/eureka/,http://10.4.48.36:8088/eureka/


# 管理员工具-系统参数 输入以下参数, 查询/设置 对应变量
# 生效时间 10 分钟左右,或者重启 apollo

对应数据库 ApolloPortalDB 表:ServerConfig

# 环境
apollo.portal.envs 
    shd,sht,gray,prod

# 部门
organizations       
    [{"orgId":"OP","orgName":"中台"},{"orgId":"OPS","orgName":"运维"}]


role.manage-app-master.enabled  # 是否开启项目管理员分配权限控制
    true
role.create-application.enabled # 是否开启创建项目权限控制
    true
温馨提示如有转载或引用以上内容之必要,敬请将本文链接作为出处标注,如有侵权我会在24小时之内删除!

欢迎使用手机扫描访问本站