CentOS 7 搭建基于携程Apollo(阿波罗)配置中心单机模式

1、环境:

JDK:1.8.0_222(注意在环境变量中的配置)

Maven:3.5.2

MySQL:5.7.18

apollo:1.3.0

2、解压
wget https://github.com/ctripcorp/apollo/archive/v1.3.0.tar.gz
tar zxvf apollo-1.3.0.tar.gz

3、导入数据库文件
登录MySQL命令行,然后执行  (注意 1.3.0版本的阿波罗下载后没有这两个sql文件,可以从之前的版本中复制过来)

soruce /data/apollo/apollo-1.3.0/scripts/db/migration/portaldb/V1.0.0__initialization.sql (1.3.0需要加上这句)

source  /data/apollo/apollo-1.3.0/scripts/sql/apolloconfigdb.sql
source /data/apollo/apollo-1.3.0/scripts/sql/apolloportaldb.sql

4、打包

修改/data/apollo/apollo-1.3.0/scripts/build.sh,把数据库账号密码修改为我们的密码以及mysql 服务器地址。只保留dev_meta,其他的都删除
#
dev_meta=http://localhost:8080
META_SERVERS_OPTS="-Ddev_meta=$dev_meta"
然后执行

./build.sh

该脚本会依次打包apollo-configservice, apollo-adminservice, apollo-portal和apollo-client。

5、启动  这里一共是启动了三个服务

apollo-configservice:

切换到目录 /data/apollo/apollo-1.3.0/apollo-configservice/target,解压apollo-configservice-1.3.0-github.zip

unzip apollo-configservice-1.3.0-github.zip –d test

执行脚本启动服务
./startup.sh
apollo-adminservice:

切换到目录 /data/apollo/apollo-1.3.0/apollo-adminservice/target,解压apollo-adminservice-1.3.0-github.zip

unzip apollo-adminservice-1.3.0-github.zip –d test

执行脚本启动服务
./startup.sh

apollo-portal:

apollo-portal的默认端口是8080,和apollo-configservice一致,所以如果需要在一台机器上同时启动apollo-portal和apollo-configservice的话,需要修改apollo-portal的端口。直接修改startup.sh中的SERVER_PORT即可,如SERVER_PORT=8070。1.3.0版本不需要修改,在里边已经默认设置的8070

切换到目录 /data/apollo/apollo-1.3.0/apollo-portal/target,解压apollo-portal-1.3.0-github.zip

unzip apollo-portal-1.3.0-github.zip –d test

修改端口:

image

执行脚本启动服务
./startup.sh

6、访问

http://localhost:8070 ,默认用户名/密码参考 Portal 实现用户登录功能

image

 

 1.3.0版本登录效果

 

posted on 2019-08-19 14:02  王大拿  阅读(3)  评论(0)    收藏  举报

导航