How to Resolve "No connections available in the pool" Error in Laravel Redis
Thank you for your continued support.
This article contains advertisements that help fund our operations.
Table Of Contents
⇨ Click here for the table of contents for Laravel articles
In Laravel's Redis,
I summarized the solution for the error "No connections available in the pool" that occurred.
Verified Environment
PHP 7.4
Laravel 6
predis 2.2
Cluster mode
Conclusion
- HOST, password, port, etc. are incorrect.
In my case,
//.env
// This is incorrect. :6379 is not needed.
REDIS_HOST=endpoint:6379
The cause of this error was that I mistakenly included the port at the end of the URL.
- Cannot be verified locally
AWS ElastiCache can only be connected from within AWS services such as EC2.
If you try to verify the connection locally, you will encounter a similar error, so be sure to verify the connection from EC2 or similar.
Why did this happen?
When you press the copy button next to the endpoint on the AWS ElastiCache management screen,
The unnecessary port is attached to the current settings.
This is an image from the management screen, and the URL has a port number at the end.
Therefore, you need to remove the part with HOST:6397.
Summary
That's all. I hope this can be helpful to someone.
This blog is supported by ad clicks. Thank you.
See you later!
Popular Articles
Deploying PHP 7.4 + Laravel 6 project to AWS EC2
Implementing Breadcrumbs in Laravel with laravel-breadcrumbs