joyieldInc / predixy

A high performance and fully featured proxy for redis, support redis sentinel and redis cluster

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confused about predixy

waittingsummer opened this issue · comments

我原来的配置是这样的三主三从三哨兵+predixy
My original configuration was like this three main three from three Sentinels +predixy

每组主从一主两从,都在同一个节点上
Each group has one master and two slaves, all on the same node

截图_选择区域_20240416092428
测试1:主节点掉线,哨兵会自动把两个从之一选为主,原先主重新上线会自动变为从
Test 1: When the primary node is offline, Sentinel will automatically select one of the two slaves as the primary. When the original master comes back online, it will automatically change to the slave

测试2:predixy根据点名自动分配数据到三主中任一,单节点上主掉线不影响数据读写
Test 2: predixy automatically allocates data to any of the three active nodes based on their names. The active node goes offline without affecting data read and write

考虑到假如这个节点整个down掉的话,那则会丢失这个节点上所有数据,且再也无法读写
Consider that if the whole node goes down, then all the data on this node will be lost and can no longer be read or written

因此考虑从节点和主节点分开不放在一个节点上,一主两从分别放在不同节点上
Therefore, consider separating the node from the master node and not placing them on one node, and placing one master and two slaves on different nodes respectively
截图_选择区域_20240416091530
这样配置,测试1仍然没问题,但是测试2时失败
With this configuration, test 1 is still fine, but test 2 fails

比如原先A数据写到23:46379,我把46379停掉,46381选举为主, 但是这时数据无法写进46381,而原先那种主从都在同一个节点时是可以的
For example, the original data A was written to 23:46379, I stopped 46379, 46381 was elected as the main, but then the data could not be written to 46381, and the original kind of master and slave are in the same node is OK