1.springcloud Finacy Release hystrix dashboard eureka 作为注册中心
hystrix 访问下载 hystrix 文件 /hystrix 一直ping ,使用zookeeper 作为注册中心的时候没有问题。
2.使用zookeeper 作为注册中心,使用Tubline 作为监控的时候一直报EurekaClient not found ,但是jar包是引入了,就是不知道为为什么找不到
已经加入hystrix 注解和 hystrix 注解对应的jar 包 和 spring-boot-acuator 的jar包 已经在bean 中创建那个/hystrix.stream 的 servlet
使用zookeeper 作为注册中心的时候是可以的,
@EnableHystrix
@EnableHystrixDashboard
@EnableEurekaClient
@EnableDiscoveryClient
//@SpringBootApplicat ion(exclude = {EurekaClientAutoConfiguration.class})
@SpringBootApplication
public class SpringcloudClientApplication {
@Bean
@LoadBalanced
RestTemplate restTemplate(){
return new RestTemplate();
}
public static void main(String[] args) {
SpringApplication.run(SpringcloudClientApplication.class, args);
}
}
#服务端口号
server:
port: 8090
#应用名称
spring:
application:
name: eureka-client
data:
mongodb:
uri: mongodb://192.168.209.128:27017/user
cloud:
#zookeeper:
#connect-string: 192.168.209.128:2181
#discovery:
#register: true
#enabled: true
#instance-id: 1
#root: /zkRoot
config:
enabled: true
discovery:
enabled: true
loadbalancer:
retry:
enabled: true
#consule:
#host: 127.0.0.1
#port: 8500
#discovery:
#register: false
security:
user:
name: wumging
password: wuming
# Redis数据库索引(默认为0)
redis:
database: 10
host: 192.168.209.128
port: 6379
timeout : 1000
ribbon:
eureka:
enabled: true
feign:
hystrix:
enabled: false
management :
endpoints:
web:
exposure:
include: hystrix.stream
#turbine:
#app-config: eureka-server,eureka-server2
#aggregator:
#clusterConfig: default
#clusterNameExpression: "'default'"
#combine-host-port: true
#instanceUrlSuffix: /hystrix.stream
hystrix:
common:
default:
execution:
timeout:
enabled: false
isolation:
thread:
timeoutInMilliseconds: 5000
#服务注册地址
eureka:
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/
<dependencies>
<dependency>
<groupId>org.springcloud</groupId>
<artifactId>springcloud-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</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-zookeeper-discovery</artifactId>
</dependency> -->
<!-- <dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.8</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<!-- <dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul</artifactId>
</dependency> -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</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-turbine</artifactId>
</dependency>
-->
org.springframework.cloud
spring-cloud-starter-netflix-eureka-client
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>