私は、外部ゲートウェイとしてSpring Boot ZuulとService DiscoveryとしてEurekaというシナリオを持っていますが、これらはすべてKubernetesで動作しています。Zuulの再試行設定がEurekaと連携していません
サービスの可用性を保証したいので、サービスのインスタンスがダウンすると、私はZuulがユーレカを通じて他のインスタンスの1つを呼び出すことを再試行することを期待しています。
これを次のようにしてみました。Ryan Baxter's post さらに、私はhereのヒントに従おうとしました。
問題は、私が作るものは、ズールが電話をやり直していないように見えるということです。インスタンスの1つを削除すると、ユーレカのアドレスが同期するまで、このインスタンスのタイムアウトが返され続けます。
マイapplication.yamlは次のようになります。
spring:
cloud:
loadbalancer:
retry:
enabled: true
zuul:
stripPrefix: true
ignoredServices: '*'
routes:
my-service:
path: /my-service/**
serviceId: my-service-api
retryable: true
my-service:
ribbon:
maxAutoRetries: 3
MaxAutoRetriesNextServer: 3
OkToRetryOnAllOperations: true
ReadTimeout: 5000
ConnectTimeout: 3000
私のサービスは(私もSR6を試してみました)カムデンSR7を使用している:
"org.springframework.cloud:spring-cloud-dependencies:Camden.SR7"
そしてまた春のリトライ:
org.springframework.retry:spring-retry:1.1.5.RELEASE
私のアプリケーションクラスは次のようになります:
@SpringBootApplication
@EnableEurekaClient
@EnableZuulProxy
@EnableRetry
public class MyZuulApplication
EDIT:
:はポストマンを介して取得作り、それが
{
"timestamp": 1497959364819,
"status": 500,
"error": "Internal Server Error",
"exception": "com.netflix.zuul.exception.ZuulException",
"message": "TIMEOUT"
}.
がZuulログを見てみるともたらし、それは{"level":"WARN","logger_name":"org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter","appName":...,"message":"Error during filtering","stack_trace":"com.netflix.zuul.exception.ZuulException: Forwarding error [... Stack Trace ...] Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: my-service-api timed-out and no fallback available [... Stack Trace ...] Caused by: java.util.concurrent.TimeoutException: null
私が見つけたもう一つの興味深いログを印刷しました
{"level":"INFO" [...] current list of Servers=[ip_address1:port, ip_address2:port, ip_address3:port],Load balancer stats=Zone stats: {defaultzone=[Zone:[ ... ]; Instance count:3; Active connections count: 0; Circuit breaker tripped count: 0; Active connections per server: 0.0;]
},Server stats: [[Server:ip_address1:port; [ ... ] Total Requests:0; Successive connection failure:0; Total blackout seconds:0; [ ... ]
, [Server:ip_address2:port; [ ... ] Total Requests:0; Successive connection failure:0; Total blackout seconds:0; [ ... ]
, [Server:ip_address3:port; [ ... ] Total Requests:0; Successive connection failure:0; Total blackout seconds:0; [ ... ]
正確な例外は何ですか? –
元の投稿をさらに編集しました –