Apollo 分布式部署
官网文档:https://www.apolloconfig.com/#/zh/deployment/distributed-deployment-guide
部署说明
- 部署DEV 和 UAT 环境
- DEV 和 UAT 环境中 分别使用独立的 Apollo Admin Service 、 Apollo Config Service 以及 Mysql 的配置库(ApolloConfigDB)
- DEV 和 UAT 环境中 公用 Apollo Protal 服务
1、下载Apollo包,地址:https://github.com/apolloconfig/apollo/releases
2、安装数据库,其中 Portal库一个 Config配置库2个,
3、解压三个压缩包,并修改数据库配置文件,
[root@H__D apollo-configservice-1.9.0]# cd config/ [root@H__D config]# ls application-github.properties app.properties [root@H__D config]# cat application-github.properties # # Copyright 2021 Apollo Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # DataSource spring.datasource.url = jdbc:mysql://196.168.0.1:3306/ApolloConfigDB?characterEncoding=utf8 spring.datasource.username = root spring.datasource.password = 123456 # Eureka ,可以修改Eureka配置 # eureka.instance.ip-address=196.168.0.1
4、修改protal服务环境信息配置文件 config/apollo-env.properties
[root@H__D apollo-portal-1.9.0]# ls apollo-portal-1.9.0-github.zip apollo-portal-1.9.0.jar apollo-portal-1.9.0-sources.jar apollo-portal.conf config scripts [root@H__D apollo-portal-1.9.0]# cd config/ [root@H__D config]# ls apollo-env.properties application-github.properties app.properties [root@H__D config]# cat apollo-env.properties # # Copyright 2021 Apollo Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # local.meta=http://localhost:8080 dev.meta=http://fill-in-dev-meta-server:8080 fat.meta=http://fill-in-fat-meta-server:8080 uat.meta=http://fill-in-uat-meta-server:8080 lpt.meta=${lpt_meta} pro.meta=http://fill-in-pro-meta-server:8080 [root@H__D config]#
5、如果要修改端口,可以修改scripts/startup.sh文件中的端口
6、如果要修改参数,可以
7、启动和关闭服务
启动:./scripts/startup.sh
关闭:./scripts/shutdown.sh
8、浏览器访问 Apollo Protal 服务