Commit 2f84c508 authored by duanledexianxianxian's avatar duanledexianxianxian 😁

🍱 Adding or updating assets.

parent 9aee62c7
Pipeline #115 failed
...@@ -18,7 +18,6 @@ springboot与spring cloud兼容版本 ...@@ -18,7 +18,6 @@ springboot与spring cloud兼容版本
- Eureka:服务治理组件,包含服务注册与发现 - Eureka:服务治理组件,包含服务注册与发现
- Hystrix(豪猪):容错管理组件,实现了熔断器 - Hystrix(豪猪):容错管理组件,实现了熔断器
- Ribbon:客户端负载均衡的服务调用组件 - Ribbon:客户端负载均衡的服务调用组件
- Feign:基于Ribbon和Hystrix的声明式服务调用组件 - Feign:基于Ribbon和Hystrix的声明式服务调用组件
- Zuul:网关组件,提供智能路由、访问过滤等功能 - Zuul:网关组件,提供智能路由、访问过滤等功能
...@@ -27,6 +26,10 @@ springboot与spring cloud兼容版本 ...@@ -27,6 +26,10 @@ springboot与spring cloud兼容版本
- Spring Cloud Security:基于spring security的安全工具包,为我们的应用程序添加安全控制 - Spring Cloud Security:基于spring security的安全工具包,为我们的应用程序添加安全控制
- Spring Cloud Consul : 封装了Consul操作,Consul是一个服务发现与配置工具(与Eureka作用类似),与Docker容器可以无缝集成 - Spring Cloud Consul : 封装了Consul操作,Consul是一个服务发现与配置工具(与Eureka作用类似),与Docker容器可以无缝集成
### 其他
- Turbine 来对服务的 Hystrix 数据进行聚合展示
### 应用端口配置 ### 应用端口配置
9000-9099: 服务注册中心端口 9000-9099: 服务注册中心端口
...@@ -39,13 +42,15 @@ springboot与spring cloud兼容版本 ...@@ -39,13 +42,15 @@ springboot与spring cloud兼容版本
9400-9499:服务网关 9400-9499:服务网关
9500-9599:监控相关端口
user-service:9204 user-service:9204
order-service:9203 order-service:9203
hystrix-dashboard:9501
### 性能指标 ### 性能指标
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-cloud-hello-world</artifactId>
<groupId>com.duanledexian.spring.cloud</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hystrix-dashboard</artifactId>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package om.duanledexian.spring.cloud.hystrix;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
/**
* @author duanledexianxianxian
* @date 2019/9/5 0:36
* @since 1.0.0
*/
@EnableHystrixDashboard
@SpringBootApplication
public class HystrixDashboardApplication {
public static void main(String[] args) {
SpringApplication.run(HystrixDashboardApplication.class, args);
}
}
server:
# 服务器端口
port: 9501
#eureka:
# client:
# serviceUrl:
# defaultZone: http://localhost:9000/eureka/
spring:
application:
name: hystrix-dashboard
...@@ -40,5 +40,9 @@ ...@@ -40,5 +40,9 @@
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId> <artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -2,6 +2,7 @@ package com.duanledexian.spring.cloud.order; ...@@ -2,6 +2,7 @@ package com.duanledexian.spring.cloud.order;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.EnableFeignClients;
...@@ -13,6 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; ...@@ -13,6 +14,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
@SpringBootApplication @SpringBootApplication
@EnableDiscoveryClient @EnableDiscoveryClient
@EnableFeignClients @EnableFeignClients
@EnableCircuitBreaker
public class SpringOrderServiceApplication { public class SpringOrderServiceApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -12,4 +12,4 @@ management: ...@@ -12,4 +12,4 @@ management:
endpoints: endpoints:
web: web:
exposure: exposure:
include: refresh,bus-refresh,info,health include: "*"
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
<module>user-service</module> <module>user-service</module>
<module>order-service</module> <module>order-service</module>
<module>zuul-api-gateway</module> <module>zuul-api-gateway</module>
<module>turbine</module>
<module>hystrix-dashboard</module>
</modules> </modules>
<dependencies> <dependencies>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-cloud-hello-world</artifactId>
<groupId>com.duanledexian.spring.cloud</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>turbine</artifactId>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-turbine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.duanledexian.spring.cloud.turbine;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.turbine.EnableTurbine;
/**
* @author duanledexianxianxian
* @date 2019/9/4 23:28
* @since 1.0.0
*/
@SpringBootApplication
@EnableTurbine
public class TurbineApplication {
public static void main(String[] args) {
SpringApplication.run(TurbineApplication.class, args);
}
}
server:
# 服务器端口
port: 9500
spring:
application:
name: turbine
turbine:
s
spring:
cloud:
config:
# 配置中心的具体地址,即 config-server
# uri: http://localhost:9300
# 对应 {application} 部分
name: turbine
# 对应 {profile} 部分
profile: dev
# 对应 {label} 部分,即 Git 的分支。如果配置中心使用的是本地存储,则该参数无用
label: master
discovery:
enabled: true
service-id: config-server
rabbitmq:
port: 9005
username: admin
password: "!admin!"
host: 113.105.144.9
eureka:
client:
service-url:
defaultZone: http://localhost:9000/eureka/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment