Repository navigation
Replies: 1 comment
|
go-redis doesn't have anything GCP-specific built in — it just needs the right connection topology pointed at it. For Memorystore with cross-region replication (secondary instances), a few things matter: Use redis.NewFailoverClient if you're using Memorystore with Sentinel-style failover, or plain redis.NewClient pointed at the read endpoint if you're doing manual read/write splitting. Memorystore's cross-region replica exposes a separate read endpoint distinct from the primary's read/write endpoint — you connect to it exactly like any other Redis instance, just with ReadOnly: true if you're using cluster mode. If you're using Memorystore Cluster mode instead of standalone-with-replica, redis.NewClusterClient with ReadOnly: true and RouteRandomly (or RouteByLatency) will handle replica read routing for you. What's your topology — standalone Memorystore with a secondary, or Cluster mode? Happy to give a more specific config if so. |
Uh oh!
There was an error while loading. Please reload this page.
GCP offers cross-regional clusters, which are essentially read-only clusters that replicate from another (the main) cluster. The secondary cluster has a totally different IP/network than the main one.
In that case, let's say someone wants to achieve the following setup:
How would one go about it? Do we still use the
ClusterClient? If so, what options should we be looking at to configure?Thanks in advance!
All reactions