ここの画像で詳しく説明されているものと非常によく似たセットアップを試しています: https://raw.githubusercontent.com/Oreste-Luci/netflix-oss-example/master/netflix-oss-example.png
私のセットアップでは、クライアント アプリケーション ( https://www.joedog.org/siege-home/ )、プロキシ (Zuul)、検出サービス (Eureka)、および単純なマイクロサービスを使用しています。すべてが PWS に展開されます。
シンプルなマイクロサービスの 1 つのバージョンから次のバージョンに、ダウンタイムなしで移行したいと考えています。最初は、 https ://docs.cloudfoundry.org/devguide/deploy-apps/blue-green.html で説明されている手法から始めました。
私の意見では、このアプローチは Eureka などの発見サービスと「互換性」がありません。実際、私のサービスの新しいバージョンは Eureka に登録されており、すべてのルート (CF ルーター) を再マッピングする前でもトラフィックを受信しています。
これにより、Spring Cloud/Netflix のフェイルオーバー メカニズムに依存する別のアプローチにたどり着きました。
- サービスの新しい (下位互換性がある) バージョンをスピンアップします。
- このバージョンが Zuul/Eureka によってピックアップされると、トラフィックの 50% を取得し始めます。
- 新しいバージョンが正しく動作することを確認したら、「古い」インスタンスを削除します。(PWSの「停止」ボタンをクリックするだけです)
私が理解しているように、Zuul はボンネットの下でリボン (負荷分散) を使用しているため、古いインスタンスがまだ Eureka にあるが実際にはシャットダウンしている一瞬で、クライアントに影響を与えずに新しいインスタンスで再試行することを期待しています。
しかし、私の仮定は間違っています。クライアントで 502 エラーがいくつか発生します。
Lifting the server siege... done.
Transactions: 5305 hits
Availability: 99.96 %
Elapsed time: 59.61 secs
Data transferred: 26.06 MB
Response time: 0.17 secs
Transaction rate: 89.00 trans/sec
Throughput: 0.44 MB/sec
Concurrency: 14.96
Successful transactions: 5305
Failed transactions: 2
Longest transaction: 3.17
Shortest transaction: 0.14
私のapplication.ymlの一部
server:
port: ${PORT:8765}
info:
component: proxy
ribbon:
MaxAutoRetries: 2 # Max number of retries on the same server (excluding the first try)
MaxAutoRetriesNextServer: 2 # Max number of next servers to retry (excluding the first server)
OkToRetryOnAllOperations: true # Whether all operations can be retried for this client
ServerListRefreshInterval: 2000 # Interval to refresh the server list from the source
ConnectTimeout: 3000 # Connect timeout used by Apache HttpClient
ReadTimeout: 3000 # Read timeout used by Apache HttpClient
hystrix:
threadpool:
default:
coreSize: 50
maxQueueSize: 100
queueSizeRejectionThreshold: 50
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000
何がうまくいかないのかわかりません。
これは技術的な問題ですか?
それとも、私は間違った仮定をしていますか (POST はとにかく再試行されないことをどこかで読みましたが、これはよくわかりません)。
どうやってそれをするのか聞いてみたいです。
ありがとう、アンディ