携程Apollo docker安装单机测试(非生产)

Apollo(阿波罗)是携程框架部门研发的分布式配置中心,能够集中化管理应用不同环境、不同集群的配置,配置修改后能够实时推送到应用端,并且具备规范的权限、流程治理等特性,适用于微服务配置管理场景。
不定期更新到gitee中,apollo代码地址
https://github.com/ctripcorp/apollo.git
https://gitee.com/nobodyiam/apollo.git

演示环境
演示环境(Demo):

106.54.227.205
账号/密码:apollo/admin

[root@kolla ~]# yum install python-pip -y
[root@kolla ~]# yum install python-devel libffi-devel gcc openssl-devel git python-pip -y
[root@kolla ~]# pip install docker-compose
[root@kolla ~]# sudo pip install docker-compose -i https://mirrors.aliyun.com/pypi/simple/
[root@kolla docker-quick-start]# pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
[root@kolla docker-quick-start]# pip install zipp -i https://mirrors.aliyun.com/pypi/simple/
[root@kolla docker-quick-start]# pip install configparser -i https://mirrors.aliyun.com/pypi/simple/

[root@kolla ~]#git clone https://gitee.com/nobodyiam/apollo.git
[root@kolla ~]# find ./ -name docker-quick-start
./apollo/scripts/docker-quick-start
[root@kolla ~]# cd apollo/scripts/docker-quick-start/
[root@kolla docker-quick-start]# docker-compose up
apollo-quick-start    | Config service started. You may visit http://localhost:8080 for service status now!
apollo-quick-start    | Waiting for admin service startup..
apollo-quick-start    | Admin service started
apollo-quick-start    | ==== starting portal ====
apollo-quick-start    | Portal logging file is ./portal/apollo-portal.log
apollo-quick-start    | Started [252]
apollo-quick-start    | Waiting for portal startup.......
apollo-quick-start    | Portal started. You can visit http://localhost:8070 now!


[root@kolla ~]# docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                            NAMES
c773ec076cf8        nobodyiam/apollo-quick-start   "/apollo-quick-start…"   47 minutes ago      Up 3 minutes        0.0.0.0:8070->8070/tcp, 0.0.0.0:8080->8080/tcp   apollo-quick-start
e419d9672312        mysql:5.7                      "docker-entrypoint.s…"   47 minutes ago      Up 3 minutes        33060/tcp, 0.0.0.0:13306->3306/tcp               apollo-db
[root@kolla ~]#


http://192.168.229.191:8070/signin 账号/密码:apollo/admin
http://192.168.229.191:8080/
注1:数据库的端口映射为13306,所以如果希望在宿主机上访问数据库,可以通过localhost:13306,用户名是root,密码留空。
注2:如要查看更多服务的日志,可以通过docker exec -it apollo-quick-start bash登录, 然后到/apollo-quick-start/service和/apollo-quick-start/portal下查看日志信息。

三、使用Apollo配置中心
使用相关步骤可以参考Quick Start - 四、使用Apollo配置中心

需要注意的是,在Docker环境下需要通过下面的命令运行Demo客户端:
[root@kolla ~]# docker exec -i apollo-quick-start /apollo-quick-start/demo.sh client
[apollo-demo][main]2020-03-29 23:04:46,696 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]2020-03-29 23:04:46,698 INFO  [com.ctrip.framework.foundation.internals.provider.DefaultServerProvider] Environment is set to [dev] by JVM system property 'env'.
[apollo-demo][main]2020-03-29 23:04:46,803 INFO  [com.ctrip.framework.apollo.internals.DefaultMetaServerProvider] Located meta services from apollo.meta configuration: http://localhost:8080!
[apollo-demo][main]2020-03-29 23:04:46,803 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.
>
>
>

你可能感兴趣的:(SpringCloudMS)