From 7ad5f0f794d4f48765ae7af3d045713c82ebd9fe Mon Sep 17 00:00:00 2001 From: Markus Snow Date: Sat, 13 Jan 2018 18:52:48 +0300 Subject: [PATCH] Added description of cluster.conf parameters usage --- doc/Config-description-for-Redis-cluster.md | 43 +++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 doc/Config-description-for-Redis-cluster.md diff --git a/doc/Config-description-for-Redis-cluster.md b/doc/Config-description-for-Redis-cluster.md new file mode 100644 index 0000000..e2afb8b --- /dev/null +++ b/doc/Config-description-for-Redis-cluster.md @@ -0,0 +1,43 @@ +## Configuration example +cluster.conf + + ClusterServerPool { + MasterReadPriority 60 + StaticSlaveReadPriority 50 + DynamicSlaveReadPriority 50 + RefreshInterval 1 + ServerFailureLimit 10 + ServerRetryTimeout 1 + Servers { + + 192.168.2.107:2211 + + 192.168.2.107:2212 + } + } + +## Configuration parameters description + +**MasterReadPriority, StaticSlaveReadPriority** and **DynamicSlaveReadPriority** - these parameters work in conjunction only in predixy and have _nothing_ with Redis configuration directives like slave-priority. As predixy can work both with Redis Sentinel or Redis Cluster deployments, two options can be used: MasterReadPriority and StaticSlaveReadPriority, or MasterReadPriority and DynamicSlaveReadPriority. + +If your Redis deployment implies nodes auto-discovery with Sentinel or other cluster nodes, the DynamicSlaveReadPriority option will be used; if you plan to add nodes in predixy config to **Servers {...}** manually, StaticSlaveReadPriority will be used. + +In other words, predixy can discover automatically added Redis-related nodes polling existing **Servers {...}** and also route queries to them, eliminating the need of manually editing of cluster.conf and restarting the predixy. + +These three parameters tell predixy in what way and proportion it should route queries to available nodes. + +Some use cases you can see below: + +| Master/SlaveReadPriority | Master | Slave1 | Slave2 | Fail-over notes | +| ------------- | ------------- | ------------- | ------------- | ------------- | +| 60/50 | all requests | 0 requests | 0 requests | Master dead, read requests deliver to slave until master(maybe new master) alive | +| 60/0 | all requests | 0 requests | 0 requests | Master dead, all requests fail | +| 50/50 | all write requests, 33.33%read requests | 33.33% read requests | 33.33% read requests | - | +| 0/50 | all write requests, 0 read requests | 50% read requests | 50% read requests | all slaves dead, all read requests fail | +| 10/50 | all write requests, 0 read requests | 50% read requests | 50% read requests | all slaves dead, read requests deliver to master | + +**RefreshInterval** - seconds, tells predixy how often it should poll nodes info and allocated hash slots in case of Cluster usage + +**ServerFailureLimit** - amount of failed queries to node when predixy stop forwarding queries to this node + +**ServerRetryTimeout** - seconds, tells predixy how often it should try to check health of failed nodes and decide if they still failed or alive and can be used for queries processing + +**Servers** - just line-by-line list of static Redis nodes in socket fashion, like `+ IP:PORT` \ No newline at end of file