环境:
CentOS Linux release 7.8.2003 (Core)
mysql:5.7.36自行部署mysql,然后按照如下导入sql
cd /datagit clone https://github.com/ctripcorp/apollo.gitmysql -uroot -pxxx < apollo/scripts/sql/apolloportaldb.sqlmysql -uroot -pxxx < apollo/scripts/sql/apolloconfigdb.sql
在这里启动Apollo的顺序是configService、adminService、portalService
部署Config Service
docker run -d --name apollo-configservice --net=host -v /tmp/logs:/opt/logs -e SPRING_DATASOURCE_URL="jdbc:mysql://192.168.216.227:3306/ApolloConfigDB?characterEncoding=utf8" -e SPRING_DATASOURCE_USERNAME=root -e SPRING_DATASOURCE_PASSWORD='xxxxx' apolloconfig/apollo-configservice
部署Admin Service:
docker run -d --name apollo-adminservice --net=host -v /tmp/logs:/opt/logs -e SPRING_DATASOURCE_URL="jdbc:mysql://192.168.216.227:3306/ApolloConfigDB?characterEncoding=utf8" -e SPRING_DATASOURCE_USERNAME=root -e SPRING_DATASOURCE_PASSWORD='xxxx' apolloconfig/apollo-adminservice
部署Portal Server:
docker run -d --name apollo-portal --net=host -v /tmp/logs:/opt/logs -e SPRING_DATASOURCE_URL="jdbc:mysql://192.168.216.227:3306/ApolloPortalDB?characterEncoding=utf8" -e SPRING_DATASOURCE_USERNAME=root -e SPRING_DATASOURCE_PASSWORD='xxxx' -e APOLLO_PORTAL_ENVS=dev -e DEV_META=http://10.45.215.90:8080 apolloconfig/apollo-portal
访问:ip+8070端口
点击系统信息不报错,表示部署成功