From 17adf19144000088e4cda41d7da38a5ea9dd9dca Mon Sep 17 00:00:00 2001 From: mscherer Date: Mon, 11 Aug 2025 13:06:39 +0200 Subject: [PATCH] Add redis cluster docs. --- en/appendices/5-3-migration-guide.rst | 6 ++++++ en/core-libraries/caching.rst | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/en/appendices/5-3-migration-guide.rst b/en/appendices/5-3-migration-guide.rst index 29501d4832..b2ede3140a 100644 --- a/en/appendices/5-3-migration-guide.rst +++ b/en/appendices/5-3-migration-guide.rst @@ -64,6 +64,12 @@ Command - ``cake server`` now supports a ``--frankenphp`` option that will start the development server with `FrankenPHP `__. +Cache +----- + +- Added Redis Cluster support to ``RedisEngine``. Configure the ``cluster`` option + with an array of server addresses to enable cluster mode. + Console ------- diff --git a/en/core-libraries/caching.rst b/en/core-libraries/caching.rst index 27f787acb9..ae6e2cd4d7 100644 --- a/en/core-libraries/caching.rst +++ b/en/core-libraries/caching.rst @@ -173,10 +173,33 @@ RedisEngine uses the following engine specific options: * ``ssl_key`` The ssl private key used for TLS connections. * ``ssl_ca`` The ssl certificate authority file for TLS connections. * ``ssl_cert`` The ssl certificate used for TLS connections. +* ``cluster`` Array of cluster server addresses for Redis Cluster support. .. versionadded:: 5.1.0 TLS connections were added in 5.1 +.. versionadded:: 5.3.0 + Redis Cluster support was added in 5.3 + +Redis Cluster Configuration +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To use Redis Cluster, configure the ``cluster`` option with an array of server addresses:: + + Cache::setConfig('redis_cluster', [ + 'className' => 'Redis', + 'duration' => '+1 hours', + 'prefix' => 'cake_redis_', + 'cluster' => [ + '127.0.0.1:7000', + '127.0.0.1:7001', + '127.0.0.1:7002', + ] + ]); + +When using Redis Cluster, the ``host`` and ``port`` options are ignored. The engine will +automatically handle key distribution and failover across the cluster nodes. + MemcacheEngine Options ----------------------