How to connect to slave instance of an Azure Redis Cache

痴心易碎 提交于 2019-12-08 13:29:32

问题


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

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

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?


回答1:


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.

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.




回答2:


The Redis service manages replication and failover, for high availability. This is not something exposed to you. That is, you cannot connect directly to the slave/secondary.



来源:https://stackoverflow.com/questions/46952010/how-to-connect-to-slave-instance-of-an-azure-redis-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!