amazon-web-services - AWS Redis - 启用/禁用集群模式。它是如何分配流量的?

标签 amazon-web-services redis aws-sdk

我们最近选择在我们的应用程序中使用 Amazon 弹性缓存 Redis,但在查看文档时有些事情不清楚。

1) Redis 的集群模式禁用集群在集群的 AWS 控制台中有主端点,当我们使用 jedis 客户端连接到主端点时,该主端点是否将读取流量分发到集群的只读副本?或者应用程序明确必须连接到集群中的只读副本?例如。 Jedis客户端

2) 为 Redis 启用的集群模式在 Redis 的 AWS 控制台中具有配置端点,因此当我们使用客户端连接到此配置端点时,配置端点是否会在集群中的分片之间分配写入和读取流量?或者应用程序必须使用传递分片主端点的 JedisCluster 对象显式连接到每个分片?

3)对于Redis启用的集群模式,弹性缓存如何跨分片分割键?

最佳答案

刚刚从链接中注意到:https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Endpoints.html ,看起来你可以使用他们的 https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Endpoints.html#Endpoints.Find.CLI.ReplGroups并发现实际端点并将它们视为常规分片/副本节点,或使用它们的端点:

Redis standalone node, use the node's endpoint for both read and write operations.

Redis (cluster mode disabled) clusters, use the Primary Endpoint for all write operations. Use the Reader Endpoint to evenly split incoming connections to the endpoint between all read replicas. Use the individual Node Endpoints for read operations (In the API/CLI these are referred to as Read Endpoints). Blockquote

因此,看起来主端点将充当代理,而读取器端点也会执行相同的操作,并进行一些负载平衡,包括根据 key 将 key 路由到正确的分片。读取客户端将仅连接到一个端点。

Redis (cluster mode enabled) clusters, use the cluster's Configuration Endpoint for all operations. You must use a client that supports Redis Cluster (Redis 3.2). You can still read from individual node endpoints (In the API/CLI these are referred to as Read Endpoints).

与以前相同,但使用单个端点进行读取和写入。这样做可能是为了使其可用性透明,并在发生问题时进行故障转移。

关于amazon-web-services - AWS Redis - 启用/禁用集群模式。它是如何分配流量的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49928606/

相关文章:

amazon-web-services - 使用云形成从 SNS 触发 lambda?

mongodb - 如何使用mongodb提高feed系统的性能

redis - Redis 是如何实现高吞吐量和性能的?

node.js - 对象存在于 Node.JS 的 AWS S3 存储桶中

javascript - 控制自定义指标在 AWS Cloudwatch 中存储的时间

linux - 如何在新的亚马逊 ec2 服务器上的浏览器中提供 html 页面或 AMI 测试页面

amazon-web-services - 将巨大的 zip 文件上传到 aws lambda 后,如何恢复 lambda 代码或内联编辑它?

php - 使用 PHP 创建 AWS 签名

Redis:为Set中的键值对设置超时

aws-lambda - Lambda Cognito 用户池授权方 - 我可以自动获取自定义用户属性吗?