Skip to content

Commit 8dd8e06

Browse files
authored
Merge pull request #8062 from cakephp/5.next-redis-cluster
Add redis cluster docs.
2 parents 6c3bbd6 + 17adf19 commit 8dd8e06

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

en/appendices/5-3-migration-guide.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ Command
6464
- ``cake server`` now supports a ``--frankenphp`` option that will start the
6565
development server with `FrankenPHP <https://frankenphp.dev/>`__.
6666

67+
Cache
68+
-----
69+
70+
- Added Redis Cluster support to ``RedisEngine``. Configure the ``cluster`` option
71+
with an array of server addresses to enable cluster mode.
72+
6773
Console
6874
-------
6975

en/core-libraries/caching.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,33 @@ RedisEngine uses the following engine specific options:
173173
* ``ssl_key`` The ssl private key used for TLS connections.
174174
* ``ssl_ca`` The ssl certificate authority file for TLS connections.
175175
* ``ssl_cert`` The ssl certificate used for TLS connections.
176+
* ``cluster`` Array of cluster server addresses for Redis Cluster support.
176177

177178
.. versionadded:: 5.1.0
178179
TLS connections were added in 5.1
179180

181+
.. versionadded:: 5.3.0
182+
Redis Cluster support was added in 5.3
183+
184+
Redis Cluster Configuration
185+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
186+
187+
To use Redis Cluster, configure the ``cluster`` option with an array of server addresses::
188+
189+
Cache::setConfig('redis_cluster', [
190+
'className' => 'Redis',
191+
'duration' => '+1 hours',
192+
'prefix' => 'cake_redis_',
193+
'cluster' => [
194+
'127.0.0.1:7000',
195+
'127.0.0.1:7001',
196+
'127.0.0.1:7002',
197+
]
198+
]);
199+
200+
When using Redis Cluster, the ``host`` and ``port`` options are ignored. The engine will
201+
automatically handle key distribution and failover across the cluster nodes.
202+
180203
MemcacheEngine Options
181204
----------------------
182205

0 commit comments

Comments
 (0)