标签:导致 改变 主机 标准 start available files space enable
# 注册Eureka服务 eureka: client: # Eureka服务注册中心会将自己作为客户端来尝试注册它自己,必須禁止 register-with-eureka: false fetch-registry: false
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
There was an unexpected error (type=Internal Server Error, status=500). status 405 reading UserFeignClient#getUser(User); content: {"timestamp":"2018-09-07T09:01:14.290+0000","status":405,"error":"Method Not Allowed","message":"Request method ‘POST‘ not supported","path":"/feign-get-user"}
错误原因: 该请求不会成功,只要参数是复杂对象,即使指定了是GET方法,feign依然会以POST方法进行发送请求。可能是我没找到相应的注解或使用方法错误。
解决办法:
// 该请求不会成功,只要参数是复杂对象,即使指定了是GET方法,feign依然会以POST方法进行发送请求。可能是我没找到相应的注解或使用方法错误。 @RequestMapping(method = RequestMethod.GET, value = "/feign-get-user") public User getUser(User user); //正确用法 @RequestMapping(method = RequestMethod.GET, value = "/feign-get-user") public User getUser(@RequestParam("id") Long id, @RequestParam("username") String username, @RequestParam("age") String age); }
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name ‘eurekaAutoServiceRegistration‘: Singleton bean creation not allowed while singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000
hystrix.command.default.execution.timeout.enabled: false
feign.hystrix.enabled: false
# application.yml (Two Peer Aware Eureka Servers). --- spring: profiles: peer1 eureka: instance: hostname: peer1 client: serviceUrl: defaultZone: http://peer2/eureka/ --- spring: profiles: peer2 eureka: instance: hostname: peer2 client: serviceUrl: defaultZone: http://peer1/eureka/
127.0.0.1 peer1 peer2 peer3
<!-- 注册Eureka服务 --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency>
<!-- 配置hystrix所需依赖的包 --> <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>
# 配置Hystrix Metrics Stream management: endpoints: web: exposure: include: hystrix.stream
<!-- Actuator是SpringBoot提供的对应用系统的自省和监控的集成功能,可以查看应用配置的详细信息; 如果提示 Unable to connect to Command Metric Stream.则需要引入以下包! --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
# 使用Hystrix Metrics Stream必备 management: endpoints: web: exposure: include: hystrix.stream
# 注册Eureka服务 eureka: client: register-with-eureka: false fetch-registry: false
<!-- Actuator是SpringBoot提供的对应用系统的自省和监控的集成功能,可以查看应用配置的详细信息; 如果提示 Unable to connect to Command Metric Stream.则需要引入以下包! --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
# 注册Eureka服务 eureka: client: # register-with-eureka: false # fetch-registry: false
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
{
"_links": {
"self": {
"href": "http://localhost:8030/actuator",
"templated": false
},
"health": {
"href": "http://localhost:8030/actuator/health",
"templated": false
},
"info": {
"href": "http://localhost:8030/actuator/info",
"templated": false
}
}
}
# 0、配置多个监控服务 turbine: appConfig: microservice-consumer-goods-feign-with-hystrix,microservice-consumer-goods-ribbon-with-hystrix clusterNameExpression: "‘default‘" # 1、仅配置监控一个服务 turbine: aggregator: clusterConfig: MICROSERVICE-CONSUMER-GOODS-RIBBON-WITH-HYSTRIX appConfig: microservice-consumer-goods-ribbon-with-hystrix
//配置hystrix所需注解 @EnableCircuitBreaker
标签:导致 改变 主机 标准 start available files space enable
原文地址:https://www.cnblogs.com/mmzs/p/10162015.html