Connect to a Redis cluster
You can connect to a Redis cloud database cluster by DNS address, private IP address, and public IP address.
We recommend connecting by DNS address because DNS addresses correspond to node roles and lead to the actual IP addresses of the master and replicas. IP addresses correspond to specific nodes. If the master is unavailable, one of the replicas will assume its role, the master's IP address will change, and the IP connection will stop working.
If the cluster is connected to a private subnet and you want to work with it via DNS, connect the cluster subnet to a cloud router with access to the external network. Use the following instructions Set up internet access via cloud router.
If the cluster is connected to a private network and you need to configure access to the node from the Internet, connect a public IP address.
Ports
Use ports to connect to Redis:
- 6380 — port for connection with SSL certificate;
- 6379 — port for connection without SSL certificate (available only for clusters in private subnet).
Ways of connection
- through Docker;
- from program code with SSL and without SSL.
Connection with SSL certificate is available for all methods.