欢迎光临
我们一直在努力

安装ctrip-apollo多环境部署总结

1、下载(https://github.com/ctripcorp/apollo/releases)apollo三个压缩文件

2、在本机安装mysql5.7
安装步骤略。

3、创建数据库
开发环境(dev):apolloconfigdb
测试呼叫(fat):apolloconfigdb2
portal:apolloportaldb
注意:一个portal管理多个环境,只需要部署一个portal程序,一个portal库。config与admin,每个环境需要个配一套。

4、修改的配置文件
4.1 portal配置
cd /data/apollo-portal/config

vim apollo-env.properties

保存

vim application-github.properties

保存

4.2 config配置
第一个config
cd /data/apollo-configservice/config/

vim application-github.properties

第二个config
cd /data/apollo-configservice/config/

vim application-github.properties

4.3 admin配置
第一个admin
cd /data/apollo-adminservice/config

vim application-github.properties

第二个admin
cd /data/apollo-adminservice/config

vim application-github.properties

5.修改apolloportaldb库的serverconfig表中的如下字段内容

注意:需要与 apollo-env.properties中的环境匹配上。

6、默认访问地址端口
8080:config、meta、eureka(有页面)
8070:portal(有页面)
8090:admin

7、config、meta、eureka在一个jvm里

8、客户端使用
8.1 spring boot项目启动,在启动类里增加@EnableApolloConfig,如:
br/>@EnableApolloConfig,如:<br/

8.2在pom文件增加依赖包

8.3其他配置如下

app.properties内容:
app.id=yuhang

apollo-env.properties内容:
dev.meta=http://192.168.41.100:8080
#fat.meta=http://apollo.fat.xxx.com
#uat.meta=http://apollo.uat.xxx.com
#pro.meta=http://apollo.xxx.com

application.properties内容:
#注入默认application namespace的配置示例
apollo.bootstrap.enabled = true
#将Apollo配置加载提到初始化日志系统之前
apollo.bootstrap.eagerLoad.enabled=true
#要使用的namespace
apollo.bootstrap.namespaces = application

9、其他使用参见
https://github.com/ctripcorp/apollo/wiki

10、环境
两台linux虚机:192.168.41.100、192.168.41.101
jdk:jdk1.8
部署路径
portal:/data/apollo-portal
admin:/data/apollo-adminservice
config:/data/apollo-configservice
本机:安装mysql5.7

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。