0

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,
        ],

    ],
MD Nasirul Islam
  • 145
  • 1
  • 11
  • maybe you need to have the .env file in both servers, from the second server you could try telnet redis_cluster_hostname 6379 to check if the connections works – c4f4t0r Sep 26 '20 at 08:28
  • i have .env file on both servers, i also can access the redis client from both of the servers. but whenever i try to generate a key using php artisan key:generate the log show me error MOVED – MD Nasirul Islam Sep 26 '20 at 09:39
  • did you try to use the same APP_KEY in both servers? – c4f4t0r Sep 26 '20 at 14:53
  • Does this answer your question? [Redis Cluster: (error) MOVED](https://serverfault.com/questions/812156/redis-cluster-error-moved) – Michael Hampton Sep 26 '20 at 16:50

0 Answers0