1. Download the git project
Address: https://github.com/apolloconfig/apollo
git clone https://github.com/apolloconfig/apollo.git
2. Preparatory work, create a mysql database
Script address: https://github.com/apolloconfig/apollo-build-scripts/tree/master/sql
Both local mysql scripts are executed
3. Configure project database connection information
The Apollo server needs to know how to connect to the database you created earlier, so you need to edit build.sh to modify the database connection string information related to ApolloPortalDB and ApolloConfigDB.
File location: ./scripts/build.sh
Note: The entered user needs to have read and write permissions to ApolloPortalDB and ApolloConfigDB data.
#apollo config db info
apollo_config_db_url="jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai"
apollo_config_db_username=用户名
apollo_config_db_password=密码(如果没有密码,留空即可)
# apollo portal db info
apollo_portal_db_url="jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8&serverTimezone=Asia/Shanghai"
apollo_portal_db_username=用户名
apollo_portal_db_password=密码(如果没有密码,留空即可)
# meta server url, different environments should have different meta server addresses
dev_meta=http://localhost:8080
fat_meta=http://localhost:8080
uat_meta=http://localhost:8080
pro_meta=http://localhost:8080
Note: Do not modify other parts of build.sh
4. Start the Apollo Configuration Center
Make sure that ports 8070, 8080, and 8090 are not occupied
lsof -i:8080
Execute the script for packaging
//项目根目录
./scripts/build.sh
The successfully packaged jar files are in
./apollo-configservice/target/apollo-configservice-1.9.1.jar
./apollo-adminservice/target/apollo-adminservice-1.9.1.jar
./apollo-portal/target/apollo-portal-1.9.1.jar
Execute three jar packages separately
java -jar ./apollo-configservice/target/apollo-configservice-1.9.1.jar
java -jar ./apollo-adminservice/target/apollo-adminservice-1.9.1.jar
java -jar ./apollo-portal/target/apollo-portal-1.9.1.jar
5. Open the page
Username: apollo
Password: admin
6. Step on the pit
6.1 log error, no folder found
Modify the log address configuration in the application.yml file under the three projects of apollo-configservice, apollo-adminservice, and apollo-portal respectively, and ensure that there is a logs folder in the relevant directory.
As in my current configuration, the startup directory is in the root directory of the apollo project, and the logs folder needs to be created in the root directory
6.2 Start the portal and report an error
Error creating bean with name 'springSecurityFilterChain' defined in class path resource
I didn't find the reason for this. The master branch I just started using has been reporting the above error, and I can't start the portal project.
Later, it was changed to the release branch and repackaged, and it was solved. It may be that the master branch is still unstable and has bugs.
6.3 The portal starts up and keeps reporting the health check log, but access to apollo is normal
Env health check failed for 1 times which less than down threshold. down threshold:2, env: DEV, meta server address: http://localhost:8080
The ip address is used for registration, which may not match the localhost. The health check reports an error, and the localhost is changed to the external network ip address of the machine, which solves the problem.
Tutorial address: