Skip to content

Commit e74a095

Browse files
1 parent a9dcf90 commit e74a095

File tree

1 file changed

+13
-0
lines changed
  • storage_versioned_docs/version-azureblob_v2.x.x/redis

1 file changed

+13
-0
lines changed

storage_versioned_docs/version-azureblob_v2.x.x/redis/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ store := redis.New(redis.Config{
8686
Addrs: []string{":6379", ":6380"},
8787
})
8888

89+
// Initialize AWS ElastiCache Redis Cluster with Configuration Endpoint
90+
store := redis.New(redis.Config{
91+
Addrs: []string{"cluster.xxxxx.cache.amazonaws.com:6379"},
92+
IsClusterMode: true,
93+
})
94+
8995
// Create a client with support for TLS
9096
cer, err := tls.LoadX509KeyPair("./client.crt", "./client.key")
9197
if err != nil {
@@ -183,6 +189,12 @@ type Config struct {
183189
//
184190
// Optional. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.
185191
PoolSize int
192+
193+
// IsClusterMode forces cluster mode even with single address.
194+
// Useful for AWS ElastiCache Configuration Endpoints.
195+
//
196+
// Optional. Default is false
197+
IsClusterMode bool
186198
}
187199
```
188200

@@ -203,6 +215,7 @@ var ConfigDefault = Config{
203215
ClientName: "",
204216
SentinelUsername: "",
205217
SentinelPassword: "",
218+
IsClusterMode: false,
206219
}
207220
```
208221

0 commit comments

Comments
 (0)