Support clients to access kvrocks cluster using LB
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- cpp, redis
- Ambito
- databases, distributed-systems
Direzione di ricerca
Inizia tracciando il comando CLUSTERX SETNODES e i percorsi di persistenza e caricamento di nodes.conf. Esamina quindi la gestione dei comandi cluster nodes, slots e replicas. Il lavoro è completato quando gli indirizzi LB opzionali persistono dopo i riavvii, le risposte del cluster rivolte ai client li utilizzano e la sincronizzazione interna e la migrazione degli slot mantengono gli IP locali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- C++
- Stelle
- 4.5k
- Fork
- 686
- Merge medio
- 2g 13h
- PR unite (30g)
- 40
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/kvrocks
-
HSETEXPIRE with an overflowing TTL returns OK and deletes the whole hashForse già presa @anubhavgupta121 l’ha presa 17 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
SSCAN, HSCAN, ZSCAN don't finish when an empty-string member is returned at the end of a pageForse già presa @ggyuchive l’ha presa oggi. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
`GEOSEARCH` / `GEORADIUS` with a negative radius hangsForse già presa @ggyuchive l’ha presa 6 giorni fa. Apertabug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
`ZDIFFSTORE` and `ZINTERSTORE` with numkeys 0 crash the server (SIGSEGV)Forse già presa @siddiqueirshad l’ha presa 8 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Support the `SUNIONCARD` commandForse già presa @PoisonGodv l’ha presa 2 giorni fa. Apertaenhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
apache/kvrocks#3723 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/kvrocks
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
eic/TimeframeBuilder#102 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
AcademySoftwareFoundation/OpenImageIO#5662 ·
I maintainer di solito rispondono entro 2 giorni
-
python
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
OpenChemistry/avogadrolibs#3295 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Tracktion/tracktion_engine#482 ·
I maintainer di solito rispondono entro 1 giorno