1、GitHub下载:
git clone https://github.com/apolloconfig/apollo-quick-start.git
2、导入apollo所需数据库:
进入MySql数据库:
mysql -uroot -p
执行以下命令(根据目录调整):
source /Users/root/Projects/apollo-quick-start/sql/apolloconfigdb.sql;
source /Users/root/Projects/apollo-quick-start/sql/apolloportaldb.sql;
3、修改数据库连接信息:
修改demo.sh脚本:
# apollo config db info
apollo_config_db_url="jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai"
apollo_config_db_username=username
apollo_config_db_password=password
# apollo portal db info
apollo_portal_db_url="jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai"
apollo_portal_db_username=username
apollo_portal_db_password=password
4、端口查询:
Quick Start脚本会在本地启动3个服务,分别使用8070, 8080, 8090端口,请确保这3个端口当前没有被使用。
lsof -i:8080
kill -9 pid
5、执行启动脚本:
./demo.sh start
当看到如下输出后,就说明启动成功了!
==== starting service ====
Service logging file is ./service/apollo-service.log
Started [80459]
Waiting for config service startup.......
Config service started. You may visit http://localhost:8080 for service status now!
Waiting for admin service startup..
Admin service started
==== starting portal ====
Portal logging file is ./portal/apollo-portal.log
Started [80552]
Waiting for portal startup.......
Portal started. You can visit http://localhost:8070 now!
6、使用:
打开http://localhost:8070 登录, 账户密码:apollo/admin