I have two servers containing the same laravel application and both are connected with a load balancer. Everything works well with the same RDS. To make the site faster I have created a Redis cluster on Elasticache and added the endpoint on the servers.
To configure the Redis PHP has predis for it. I unassigned a server from the load balancer and configured the server one by one. The fast server worked but the second server is not working. While I configure the first server the server sends data on the Redis cluster to save some data on the cluster while I configure the second one couldn't be able to fetch those data and use it as it's own. So it gives me
moved 6379 10.10.1.0 ....something
for this, I was not been able to use the second server while enabling Redis. Though the first server is doing great with redis no problem with that. But i was not being able to use redis on second server. Can anyone help me with this?
I want to make two servers working together with the same redis cluster.
Here is my redis config
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],