如何连接到 Azure Redis 缓存的从属实例 [英] How to connect to slave instance of an Azure Redis Cache

查看:109
本文介绍了如何连接到 Azure Redis 缓存的从属实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure Redis 缓存的标准高级定价层提供主/从复制:

The standard and premium pricing tiers of Azure Redis Cache provide master/slave replication:

标准 - 双节点主/辅助中的复制缓存由 Microsoft 管理的配置,具有高可用性 SLA.

Standard—A replicated cache in a two-node primary/secondary configuration managed by Microsoft, with a high-availability SLA.

但 Azure 门户仅提供单个 redis 实例的连接详细信息(主机名、端口、密钥).有没有办法连接到副本中的从进程?

But the Azure portal provides connection details (hostname, port, key) for only a single redis instance. Is there a way to connect to connect to the slave process in a replica?

推荐答案

由于 Azure Redis 服务代表您管理复制和自动故障转移,因此不要对哪个节点是主节点进行任何假设,因为这可能会在故障转移.因此,该服务仅公开一个端点,并确保对该端点的任何请求都命中正确的 Master.技术上可以连接到 Master 或 Slave,但 Azure 不会公开它,它需要在客户端检查以确保节点确实是 Master 或 Slave.

Since the Azure Redis service manages replication and automatic failover on your behalf, it is useful not to make any assumptions about which node is Master as that could change on a failover. Hence the service exposes only one endpoint and ensures that any requests to that endpoint hit the correct Master. It is technically possible to connect to Master or Slave, but Azure doesn't expose it and it requires checks on the client side to ensure that the node is indeed Master or Slave.

如果开启集群,则使用Redis集群协议.在此协议下,您可以运行集群节点命令,它应该返回获取主节点和从节点的列表以及每个节点正在侦听的端口.

If you turn on clustering, the Redis cluster protocol is used. Under this protocol, you can run a cluster nodes command and it should return get a list of Master and slave nodes and the ports that each of these are listening on.

这篇关于如何连接到 Azure Redis 缓存的从属实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆