In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today I will show you how to use apollo easily. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.
Apollo is a synchronous configuration tool similar to springcloud's remote git library config pull configuration.
Quick start: finally started with the zip package, but could not be started with 1.7
Download link: https://pan.baidu.com/s/1tIWZlve9duCeOx0RpqSCdg extraction code: gqvr modifies the configuration of the downloaded zip package after decompression Importing data is mainly about starting scripts that need to be changed in demo.sh. # these two databases have to be created (you import 2 databases in the downloaded project) # apollo config db infoapollo_config_db_url=jdbc:mysql://localhost:3306/ApolloConfigDB?characterEncoding=utf8apollo_config_db_username=managerapollo_config_db_password=123# apollo portal db infoapollo_portal_db_url=jdbc:mysql://localhost:3306/ApolloPortalDB?characterEncoding=utf8apollo_portal_db_username=managerapollo_portal_db_password=123# script Demo.sh checkServerAlive method here I changed the max_counter24 to 50, otherwise the startup time is too short to get up. Function checkServerAlive {declare-I counter=0 declare-I max_counter=50 # 2405remote 120s declare-I total_time=0 start and stop server login portalsh. / demo start | stop # start and stop service sh. / demo client # start demo # enter timeout return time, enter quit exit default starts 3 ports 8070 | 8080 | 8090portal page default account: apollo password: admin modify configuration
Click sampleapp to enter the demo project synchronization configuration
Click modify, publish, and discover that the demo has changed to the modified configuration, and synchronize to the demo configuration.
Simple integration of springboot project
Reference: https://github.com/ctripcorp/apollo/wiki/Java%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97#3213-spring-boot%E9%9B%86%E6%88%90%E6%96%B9%E5%BC%8F%E6%8E%A8%E8%8D%90
Import maven dependencies
Com.ctrip.framework.apollo apollo-client 1.5.1
Yml configuration
App: id: SampleApp # Project id (specified by the server) apollo: meta: http://localhost:8080 # Project Server address server: port: 8010 # own project port
Code modification test pull configuration
Package top.heliming.tomcat7war;//import org.junit.Test;import com.ctrip.framework.apollo.Config;import com.ctrip.framework.apollo.ConfigService;import org.junit.jupiter.api.Test;import org.springframework.boot.test.context.SpringBootTest;@SpringBootTestclass Tomcat7warApplicationTests {@ Test void contextLoads () {Config appConfig = ConfigService.getAppConfig (); String property = appConfig.getProperty ("timeout", "0"); System.out.println (property);}}
These are all the contents of how to use apollo simply. You can search the previous articles or browse the following articles to learn more about how to use apollo. I believe the editor will add more knowledge to you. I hope you can support it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.