I want to connect redis cluster from Laravel but I am getting No connections available in the pool
. My databaase.php looks like
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
'clusters' => [
'default' =>
[
[
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
]],
'options' => [
'cluster' => 'redis', // This tells Redis Client lib to follow redirects (from cluster)
]
],
]
But with this settings, I am getting No connections available in the pool. But if I just connect redis cluster using cli, I can successfully connect. So I believe there is something wrong with my laravel configuration that I am still unable to solve. Any help?
Solution
Hi guys, it was a configuration issue. I was using wrong port. The default port is 6379 and I was mistakenly using another port number.
2
Answers
Moving the
options
to the parent array should solve your problem.What about adding
scheme
and movingoptions
?