Support clients to access kvrocks cluster using LB
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cpp, redis
調査の方向性
まず、CLUSTERX SETNODES コマンドと、nodes.conf の永続化および読み込みのパスを追跡します。次に、cluster nodes、slots、replicas コマンドの処理を調査します。オプションの LB アドレスが再起動後も永続化され、クライアント向けの cluster レスポンスでそれらが使用され、内部同期とスロット移行でローカル IP が保持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Search before asking
- I had searched in the issues and found no similar issues.
Motivation
In the following situations, a master-slave switchover in a Kvrocks cluster may cause a split-brain situation:
- The Kvrocks process hangs and then recovers
- The network card on the Kvrocks host fails and then recovers
- The network partition on the Kvrocks host recovers
When the Kvrocks process regains access, client requests may be directed to the old master node for a brief period, causing a split-brain situation and data inconsistency.
If clients access Kvrocks using a load balancer (LB), when a Kvrocks cluster switchover occurs, redirecting the LB address to the new master node ensures that client requests are not forwarded to the old master node.
The Kvrocks cluster deployment architecture is as follows:
Benefits of this architecture:
- It covers most split-brain scenarios, including process restarts, process hangs, host network interface downtime, and network partitions.
- Using a load balancer (LB) accelerates failover, significantly faster than approaches such as using dynamic domain names on the client side.
This approach is used in both AWS Elasticache and Azure Redis.
Solution
To ensure that client access to the KvRocks cluster goes through the load balancer (LB), while maintaining local IP for internal KvRocks cluster communication (master-slave synchronization and slot migration), the following modifications are required:
-
Add two optional parameters to the clusterx setnodes command to specify a CLB host for each node.
The following example shows that you can specify some or all LBs:
CLUSTERX SETNODES "ZrFserb4Mqi5dbyCLCMUm9zFXMNPhzKE4RbFauJa 10.190.28.10 7115 master - 0-5460 \n qhbVLW9dc2VF9CZOmvBJOzzqkhNA3oHoD3NVWVyg 10.190.28.10 7133 master - 5461-10921 \n 9cnjXnaNK5KfPtX01V0wn7ZtM7FDPnz7va9qPJBs 10.190.28.10 7237 master - 10922-16383 192.168.0.2 1222\n fuCHh8Ru9tFSY313QPfBcPQ3QeP63Z4rWpqpyaOl 10.190.28.10 7255 slave ZrFserb4Mqi5dbyCLCMUm9zFXMNPhzKE4RbFauJa \n cIqdj5C37cMrr7r7ydZDZ8zm1T1vPLMWj8516rrF 10.190.28.10 6741 slave qhbVLW9dc2VF9CZOmvBJOzzqkhNA3oHoD3NVWVyg \n 3D8JRN8YVONqRU57jP99E3JdH2QnLHzZpFN4rcQQ 10.190.28.10 6765 slave 9cnjXnaNK5KfPtX01V0wn7ZtM7FDPnz7va9qPJBs 192.168.0.1 1234" 1754120940 -
When persisting nodes.conf to a local file, add the LB address information to the file. When the kvrovks process starts, it will also load the corresponding LB address information.
-
When executing the cluster nodes/slots/replicas commands, if the nodes have a LB host configured, replace it with LB host.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- 主要言語
- C++
- スター
- 4.5k
- フォーク
- 686
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 40
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/kvrocks のほかの issue
-
HSETEXPIRE with an overflowing TTL returns OK and deletes the whole hash対応中かも @anubhavgupta121 が 18 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
SSCAN, HSCAN, ZSCAN don't finish when an empty-string member is returned at the end of a page対応中かも @ggyuchive が 1 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
`GEOSEARCH` / `GEORADIUS` with a negative radius hangs対応中かも @ggyuchive が 7 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
`ZDIFFSTORE` and `ZINTERSTORE` with numkeys 0 crash the server (SIGSEGV)対応中かも @siddiqueirshad が 8 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
Support the `SUNIONCARD` command対応中かも @PoisonGodv が 3 日前に担当しました。 オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
apache/kvrocks#3723 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
enhancement third-party
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pocoproject/poco#5656 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
Qiskit/qiskit-aer#2525 ·
メンテナーはふだん 1 日以内に返信