forezp / SpringCloudLearning

《史上最简单的Spring Cloud教程源码》
17.85k stars 8.06k forks source link

hystrix dashbord 后台报错 Error proxying request: http://localhost:8762/actuator/hystrix.stream?delay=2000 java.net.SocketTimeoutException: Read timed out #49

Open aijingaiyi opened 4 years ago

aijingaiyi commented 4 years ago

sfc-chapter-12 工程运行,hystrix dashborad出现错误Unable to connect to Command Metric Stream,hystrix dashboard请求路径为:http://localhost:8762/actuator/hystrix.stream

前台报错如下:

EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.

后台错误如下:

Proxy opening connection to: http://localhost:8762/actuator/hystrix.stream?delay=2000 2019-09-26 11:31:23.536 ERROR 135936 --- [nio-8762-exec-2] ashboardConfiguration$ProxyStreamServlet : Error proxying request: http://localhost:8762/actuator/hystrix.stream?delay=2000 java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.8.0_181] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[na:1.8.0_181]

浏览器直接请求:http://localhost:8762/actuator/hystrix.stream正常返回结果

data: {"type":"HystrixCommand","name":"home","group":"ServiceHiApplication$$EnhancerBySpringCGLIB$$541db1ca","currentTime":1569468427754,"isCircuitBreakerOpen":false,"errorPercentage":0,"errorCount":0,"requestCount":0,"rollingCountBadRequests":0,"rollingCountCollapsedRequests":0,"rollingCountEmit":0,"rollingCountExceptionsThrown":0,"rollingCountFailure":0,"rollingCountFallbackEmit":0,"rollingCountFallbackFailure":0,"rollingCountFallbackMissing":0,"rollingCountFallbackRejection":0,"rollingCountFallbackSuccess":0,"rollingCountResponsesFromCache":0,"rollingCountSemaphoreRejected":0,"rollingCountShortCircuited":0,"rollingCountSuccess":0,"rollingCountThreadPoolRejected":0,"rollingCountTimeout":0,"currentConcurrentExecutionCount":0,"rollingMaxConcurrentExecutionCount":0,"latencyExecute_mean":0,"latencyExecute":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"latencyTotal_mean":0,"latencyTotal":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"propertyValue_circuitBreakerRequestVolumeThreshold":20,"propertyValue_circuitBreakerSleepWindowInMilliseconds":5000,"propertyValue_circuitBreakerErrorThresholdPercentage":50,"propertyValue_circuitBreakerForceOpen":false,"propertyValue_circuitBreakerForceClosed":false,"propertyValue_circuitBreakerEnabled":true,"propertyValue_executionIsolationStrategy":"THREAD","propertyValue_executionIsolationThreadTimeoutInMilliseconds":1000,"propertyValue_executionTimeoutInMilliseconds":1000,"propertyValue_executionIsolationThreadInterruptOnTimeout":true,"propertyValue_executionIsolationThreadPoolKeyOverride":null,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"propertyValue_requestCacheEnabled":true,"propertyValue_requestLogEnabled":true,"reportingHosts":1,"threadPool":"ServiceHiApplication$$EnhancerBySpringCGLIB$$541db1ca"} 请问怎么解决这个问题

aijingaiyi commented 4 years ago

放在linux上面跑就可以了