这里记录一个spring cloud的模板,有的模块spring cloud eureka + spring boot admin + spring cloud zuul + 一个普通spring cloud服务service -A

eureka-server:注册中心,api-gateway:网关,Admin-Server:spring boot admin的服务端,Service-A:普通服务A

1、注册中心

在浏览器中输入localhost:1111,然后输入waterlufei,123456就可以看到注册中心

注册中心这一块,允许自己注册(便于adminserver监控到),关闭服务安全保护,开启权限控制

2、普通服务

访问localhost:4445/test能返回接口数据hahah,访问localhost:4445能够看到我们自己写的主页

3、服务网关

访问localhost:2222/api-a/test能返回接口数据hahah,访问localhost:2222/api-a/能够看到我们自己写的主页,实现了通过网关访问

4、admin服务端

访问localhost:9527,输入waterlufei,9527能够看到性能监控页面

 

 

 

 随便点进去一个可以看到服务的各种性能日志等

 

需要注意的:

1.如果需要看到log选项,需要在服务的配置文件中,指定生成日志文件

2.admin-server指定的服务名称必须都是小写

github源码地址:https://github.com/waterlufei/spring-cloud

posted on 2017-08-09 21:43  请叫我小路飞  阅读(1447)  评论(0编辑  收藏  举报