版权声明:本文为博主原创文章,未经允许不得转发 https://blog.csdn.net/fengchen0123456789/article/details/86605056
下载
下载 https://github.com/nobodyiam/apollo-build-scripts 目录中有 sql 文件夹
在本地新建2个数据库,名字和sql文件一样,也可以自定,改一下sql对应的名字即可,新建好之后,分别导入sql到相应数据库 导入不了解参考 https://blog.csdn.net/fengchen0123456789/article/details/78697090
修改配置
修改 demo.sh 文件,把数据库对应改一下,还有 meta server url,如下
# apollo config db info apollo_config_db_url=jdbc:mysql://127.0.0.1:3306/ApolloConfigDB?characterEncoding=utf8 apollo_config_db_username=root apollo_config_db_password=admin # apollo portal db info apollo_portal_db_url=jdbc:mysql://127.0.0.1:3306/ApolloPortalDB?characterEncoding=utf8 apollo_portal_db_username=root apollo_portal_db_password=admin # meta server url config_server_url=http://localhost:8080 admin_server_url=http://localhost:8090 eureka_service_url=$config_server_url/eureka/ portal_url=http://localhost:8070 保存退出
启动
确保 3个端口号未被占用,可以用此命令查询
lsof -i:8080
启动
./demo.sh start
关闭
./demo.sh stop
当看到如下日志,则启动成功
==== starting service ==== Service logging file is ./service/apollo-service.log Started [2618] 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 [2824] Waiting for portal startup..... Portal started. You can visit http://localhost:8070 now! 访问
浏览器输入 http://127.0.0.1:8070
默认用户名 apollo
密码 admin
登陆成功即环境搭建成功,自己去看吧
文章来源: https://blog.csdn.net/fengchen0123456789/article/details/86605056