新环境的配置端口设置为8180 管理端口设置为8190
apollo添加新环境需要复刻apollo-configservice和apollo-adminservice(每个环境要求有独立的这些配置),apollo-portal是公用的
1、创建新的apolloconfigdb库,操作很简单直接编辑原生的 apolloconfigdb.sql文件 修改如下三个部分就可以
(1)、数据库名字换成ApolloConfigDB_fat
(2)、端口换成8180(新服务) 'default', 'http://localhost:8180/eureka/'
(3)、再次导入mysql数据库
2、apollo-configservice的配置
路径:/soft/apollo/apollo-portal/src/main/config
文件:application-github.properties
spring.datasource.url = jdbc:mysql://localhost:3306/ApolloPortalDB_fat?useSSL=false&characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = 123456
路径:/soft/apollo/apollo-configservice
如下文件的端口都要从8080换成8180
src/main/resources/application.yml
src/main/resources/bootstrap.yml
src/main/resources/configservice.properties
src/main/scripts/startup.sh
3、apollo-adminservice的配置
路径:/soft/apollo/apollo-adminservice/src/main/config
文件:application-github.properties
spring.datasource.url = jdbc:mysql://localhost:3306/ApolloConfigDB_fat?useSSL=false&characterEncoding=utf8
spring.datasource.username = root
spring.datasource.password = 123456
路径:/soft/apollo
如下文件的端口都要从8090换成8190
# grep -r 8190|grep -v target
apollo-adminservice/src/main/resources/adminservice.properties:server.port= 8190
apollo-adminservice/src/main/resources/application.yml: port: 8190
apollo-adminservice/src/main/scripts/startup.sh:SERVER_PORT=${SERVER_PORT:=8190}
4、编译即可
编译文件路径:/soft/apollo/scripts
#build.sh 执行完毕即可
5、启动服务
创建工作目录
#mkdir -p /soft/apollo-service/{apollo-configservice_fat,apollo-adminservice_fat,apollo-portal}
拷贝编译生成后的文件
#cp /soft/apollo/apollo-configservice/target/apollo-configservice-1.7.0-SNAPSHOT-github.zip /soft/apollo-service/apollo-configservice_fat/
#cp /soft/apollo/apollo-adminservice/target/apollo-adminservice-1.7.0-SNAPSHOT-github.zip /soft/apollo-service/apollo-adminservice_fat/
#cp /soft/apollo/apollo-portal/target/apollo-portal-1.7.0-SNAPSHOT-github.zip /soft/apollo-service/apollo-portal/
进入各自的目录unzip文件 进scipts目录启动服务即可
#uat,lpt,pro都可以按照这个步骤操作,只需要换configservice和adminservice的端口即可