https://github.com/nobodyiam/apollo-build-scripts https://github.com/ctripcorp/apollo
./demo.sh start
会启动三个服务,config service配置服务,admin service管理服务,portal service前端服务,正常启动日志如下$ ./demo.sh start
Windows new JAVA_HOME is: /d/Java/jdk1.8.0_161
==== starting service ====
Service logging file is ./service/apollo-service.log
Started [2156]
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 [3252]
Waiting for portal startup.......
Portal started. You can visit http://localhost:8070 now!
localhost:8070
显示如下,默认账号密码apollo/admin
./demo.sh client
启动$ ./demo.sh client
Windows new JAVA_HOME is: /d/Java/jdk1.8.0_161
[apollo-demo][main]2019-03-15 16:17:56,913 INFO [com.ctrip.framework.foundation.internals.provider.DefaultApplicationProvider] App ID is set to SampleApp by app.id property from /META-INF/app.properties
[apollo-demo][main]2019-03-15 16:17:56,916 INFO [com.ctrip.framework.foundation.internals.provider.DefaultServerProvider] Environment is set to [dev] by JVM system property 'env'.
[apollo-demo][main]2019-03-15 16:17:57,023 INFO [com.ctrip.framework.apollo.internals.DefaultMetaServerProvider] Located meta services from apollo.meta configuration: http://localhost:8080!
[apollo-demo][main]2019-03-15 16:17:57,024 INFO [com.ctrip.framework.apollo.core.MetaDomainConsts] Located meta server address http://localhost:8080 for env DEV from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider
Apollo Config Demo. Please input key to get the value. Input quit to exit.
> timeout
Loading key : timeout with value: 100
> poolsize
Loading key : poolsize with value: undefined
C:/opt/settings/server.properties
该目录创建这个文件,内容写上env=DEV
apollo.meta=http://localhost:8080
表示启动环境DEV开发环境和config service服务地址
http://{portal地址}/user-manage.html
,这里就是http://localhost:8070/user-manage.html
注意:需要点击发布才能生效
结果
通过上述测试已经实现了后台页面配置实时修改,客户端实时接收修改配置值,我们已经初步了解apollo的基本功能,接下来需要研究下客户端需要如何配置才能实现需求了,下章继续^_^