ApolloPortalDB:
ApolloConfigDB:
官方地址:https://github.com/ctripcorp/apollo
本次测试版本为:0.10.2
下载地址:https://github.com/ctripcorp/apollo/releases/tag/v0.10.2
apollo-adminservice-0.10.2-github.zip
apollo-configservice-0.10.2-github.zip
apollo-portal-0.10.2-github.zip
主机:10.2.42.27
创建apollo用户:
配置configserver:
cd /home/apollo/ mkdir apollo-config unzip apollo-configservice-0.10.2-github.zip -d apollo-configApolloconfigDB配置:
vim apollo-config/config/application-github.properties # DataSource spring.datasource.url = jdbc:mysql://10.2.42.28:3306/ApolloConfigDB?characterEncoding=utf8 spring.datasource.username = Apollo spring.datasource.password = Apollo日志路径及JVM参数修改:部分配置,后面的配置不需要修改
vim apollo-config/scripts/startup.sh # 修改日志路径 LOG_DIR=http://www.likecs.com/home/apollo/logs/100003171 # 默认端口 SERVER_PORT=8080 # 默认注释看需求打开 ## Adjust memory settings if necessary export JAVA_OPTS="-Xms6144m -Xmx6144m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=4096m -XX:MaxNewSize=4096m -XX:SurvivorRatio=8"启动Apollo-configservice:
cd /home/apollo/ chown -R apollo.apollo * su apollo ./apollo-config/scripts/startup.sh启动成功:
Thu Jul 18 15:06:53 CST 2019 ==== Starting ==== Started [53700] Waiting for server startup...... Thu Jul 18 15:07:24 CST 2019 Server started in 30 seconds! apollo-admin主机:10.2.42.28
groupadd apollo && useradd -g apollo apollo cd /home/apollo/ mkdir {apollo-admin,apollo-portal} unzip apollo-adminservice-0.10.2-github.zip -d apollo-admin unzip apollo-portal-0.10.2-github.zip -d apollo-portalApolloconfigDB配置:
cd apollo-admin vim config/application-github.properties # DataSource spring.datasource.url = jdbc:mysql://10.2.42.28:3306/ApolloConfigDB?characterEncoding=utf8 spring.datasource.username = Apollo spring.datasource.password = Apollo日志路径及JVM参数配置:部分配置,后面的配置不需要修改
vim scripts/startup.sh #!/bin/bash SERVICE_NAME=apollo-adminservice ## Adjust log dir if necessary LOG_DIR=http://www.likecs.com/home/apollo/logs/100003172 ## Adjust server port if necessary SERVER_PORT=8090 ## Adjust memory settings if necessary export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"启动apollo-admin:
cd /home/apollo/ chown -R apollo.apollo * su apollo ./scripts/startup.sh Thu Jul 18 16:17:32 CST 2019 ==== Starting ==== Started [56497] Waiting for server startup...... Thu Jul 18 16:18:02 CST 2019 Server started in 30 seconds! apollo-portal主机:10.2.42.28
apolloportlDB配置:
configservice配置:一套portal可以管理多个configservice,也可以直接配置在startup.sh脚本里
vim config/apollo-env.properties local.meta=http://localhost:8080 dev.meta=http://10.2.42.27:8080 fat.meta=http://10.2.42.27:8080 uat.meta=${lpt_meta} lpt.meta=${lpt_meta} pro.meta=${lpt_meta}日志路径及JVM参数修改:部分配置,后面的配置不需要修改
vim scripts/startup.sh #!/bin/bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary LOG_DIR=http://www.likecs.com/home/apollo/logs/100003173 ## Adjust server port if necessary SERVER_PORT=8070 ## Adjust memory settings if necessary export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"