Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

simonw's avatar

Redis - database.php configuration

Hi, What's the point of the clusters array in the redis config? I don't get any change between putting my connection details within the clusters array, or just keeping them on the root of the redis config.

'redis' => [

        'client' => 'predis',
        'cluster' => true,

        'clusters' => [
        ],

        'default' => [
            ....

Having the default connection inside or outside of the clusters config makes no difference, and i'm running clusters so I don't know what the point of that setting is!

That said, I'm also getting the MOVED error right now, but that's not what this question is about!

Thanks :)

0 likes
2 replies
simonw's avatar

Hi, yes I did. It doesn't really explain anything. It just says If your application is utilizing a cluster of Redis servers, you should define these clusters within a clusters key of your Redis configuration, but putting code in the array or in the root made no difference to my errors so I couldn't understand if it was actually doing anything.

My issue was that whether I put the config in clusters or in the redis array root, it was still giving the same errors so seemed like it wasn't doing anything. Then I took a deeper dive in to RedisManager in the Laravel core and discovered that each cluster key expects an array of connections, not just a single.

So clusters.default = [ [], [], [] ] as opposed to the root config expecting redis.default = []

Please or to participate in this conversation.