Question

Error: Server closed the connection

Every time I start my redis cluster and connect to it, I get this error when trying to run any command. Error: Server closed the connection

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

For anyone who lands on this page with connection issues using Node to connect to a DO Redis DB, TLS is required. You can use the URL method to connect which is redis with 2 s’s…

rediss://…

or construct the connection and set TLS to true.

const client = redis.createClient({ host: process.env.REDIS_HOST, port: process.env.REDIS_PORT, password: process.env.REDIS_PASSWORD, TLS: true });

Hey,

What client are you using to connect? As mentioned in our documentation, the official redis-cli client does not yet support TLS, which is required to connect to our managed redis. With that in mind, we suggest connecting using redli, which does support TLS and has been tested to work properly with our managed redis.

Best, Eris Customer Success Engineer

This comment has been deleted