Menu
Amazon ElastiCache
User Guide (API Version 2015-02-02)

Connecting to Nodes in a Redis Cluster

Note

At this time, clusters (API/CLI: replication groups) that support replication and read replicas are only supported for clusters running Redis.

For clusters, ElastiCache provides console, CLI, and API interfaces to obtain connection information for individual nodes.

For read-only activity, applications can connect to any node in the cluster. However, for write activity, we recommend that your applications connect to the primary endpoint (Redis (cluster mode disabled)) or configuration endpoint (Redis (cluster mode enabled)) for the cluster instead of connecting directly to a node. This will ensure that your applications can always find the correct node, even if you decide to reconfigure your cluster by promoting a read replica to the primary role.

Connecting to Clusters in a Cluster (Console)

To determine endpoints and port numbers

Connecting to Clusters in a Replication Group (AWS CLI)

To determine cache node endpoints and port numbers

Use the command describe-replication-groups with the name of your replication group:

Copy
aws elasticache describe-replication-groups my-repgroup

This command should produce output similar to the following:

Copy
REPLICATIONGROUP my-repgroup My replication group available CLUSTERID my-redis-primary CLUSTERID my-replica-1 NODEGROUP 0001 my-repgroup.f310xz.ng.0001.cache.amazonaws.com 6379 available NODEGROUPMEMBER my-redis-primary 0001 my-redis-primary.f310xz.0001.cache.amazonaws.com 6379 us-west-2a primary NODEGROUPMEMBER my-replica-1 0001 my-replica-1.f310xz.0001.cache.amazonaws.com 6379 us-west-2b replica

Connecting to Clusters in a Replication Group (ElastiCache API)

To determine cache node endpoints and port numbers

Call DescribeReplicationGroups with the following parameter:

ReplicationGroupId = the name of your replication group.

Example

Copy
https://elasticache.us-west-2.amazonaws.com / ?Action=DescribeCacheClusters &ReplicationGroupId=repgroup01 &Version=2014-09-30 &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Timestamp=20140421T220302Z &X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Date=20140421T220302Z &X-Amz-SignedHeaders=Host &X-Amz-Expires=20140421T220302Z &X-Amz-Credential=<credential> &X-Amz-Signature=<signature>