Redis is an open source, key-value database built with an in-memory design that emphasizes speed. It has support for rich data types, atomic operations, and Lua scripting.
To troubleshoot issues with Redis on DigitalOcean Managed Databases, you will need to connect to your Redis cluster with a local Redis client. However, the default Redis command line client,
redis-cli, does not support TLS/SSL, and all connections to DigitalOcean Redis databases are encrypted with TLS/SSL to protect your data in transit.
Workarounds like tunneling exist, but for simplicity, you can access Redis on DigitalOcean Managed Databases from the command line using redli, a Redis interactive terminal. To do this, you’ll need two things:
Redli installed on your local machine, which lets you use the
redli command in a terminal.
The database’s connection parameters.
Use the Flags format with the
redli command, which supplies the variables as individual flags that are easier to read and customize. From the Databases page, open the database’s More menu, then select Connection details and click Flags.
Before troubleshooting connection problems, check the DigitalOcean status page for ongoing issues in your database’s region.
The connection string passes different parameters to
redli via Flags. Here’s a high-level breakdown of what information those flags correspond to:
Hostname and Port:
The hostname is specified with the
-h flag, and tells your client computer how to reach the cluster. Port is specified with the
-p flag. If you do not specify a port, the client will attempt to use the default Redis port,
The password is specified with the
--auth) flag. If you do not use the
-a flag, you will have to explicitly use the
AUTH command once connected.
Redis Managed Databases on DigitalOcean require you to connect using SSL/TLS. To do this with
redli, specify the encryption with the
You can find a more comprehensive list of the flags you can pass to the
redli command in the official documentation for
redli at Redli — a humane alternative to redis-cli.
Below are some common Redis database connectivity errors, along with likely causes and solutions. You can find out more information on the different errors in the official
2019/07/23 11:34:26 Dial ERR invalid password
This error occurs when the password being passed with the
-a flag is incorrect. To resolve the issue, double-check the password you’re using.
2019/07/23 11:38:54 Dial EOF
This error occurs when the command does not contain the
--tls flag, or is otherwise unable to encrypt the connection. To troubleshoot this issue, make sure your connection string includes the
--tls flag. If it does, check that your local computer’s certificate store is up to date.
2019/07/23 11:48:17 Dial dial tcp 203.0.113.0:25061: connect: connection refused
This error occurs when the port specified with the
-p flag is incorrect. To resolve this issue, make sure you’re specifying the correct port number in the connection string.
Could not connect to Redis at example-database-redis-do-user-6607903-0.a.db.ondigitalocean.com:25061: Operation timed out not connected>
This error occurs when the database’s firewall won’t allow you to connect to the database from your current machine or resource. If you are getting this error, check that you have added the machine or resource you are connecting from to the database’s list of trusted sources.