【Azure Redis 缓存】Azure Redis Cluster 在增加分片数时失败分析
问题描述
Azure Redis Cluster 在增加分片数时失败,错误消息为:
ResponseBody: { "error": { "details": [], "code": "SubnetIsFull", "message": "Subnet Redis with address prefix 12.12.12.0/28 does not have enough capacity for 2 IP addresses." } }
问题分析
根据错误消息里面的Address Prefix 12.12.12.0/28 计算出子网中的IP地址数量只有15个。
(Source : https://jodies.de/ipcalc?host=12.12.12.0&mask1=28&mask2= )
因为Azure服务会保留5个IP地址,所以当把Redis Cluster服务集成到这个子网后,Redis服务可用的IP地址只剩下10个。而Redis集群至少包含一个分片和一个Load Balancer(负载均衡器)。每一个分片包含两个VM实例,所以需要占用3个IP地址。如此计算,上面的子网中,最多能承载的Redis集群分片数目为 4 (15-5-1- 2*4 =1)。所以剩下的一个不足以添加第五个分片,就会报出 “SubnetIsFull” 异常。
由于Azure VNET Subnet在添加后就不能在修改IP地址范围,所以无法动态扩容(添加更多IP地址),只能删除重建子网。
Azure服务保留IP介绍:
Are there any restrictions on using IP addresses within these subnets?
Yes. Azure reserves 5 IP addresses within each subnet. These are x.x.x.0-x.x.x.3 and the last address of the subnet. x.x.x.1-x.x.x.3 is reserved in each subnet for Azure services.
- x.x.x.0: Network address
- x.x.x.1: Reserved by Azure for the default gateway
- x.x.x.2, x.x.x.3: Reserved by Azure to map the Azure DNS IPs to the VNet space
- x.x.x.255: Network broadcast address for subnets of size /25 and larger. This will be a different address in smaller subnets.
参考资料
Configure virtual network support for a Premium Azure Cache for Redis instance:https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-how-to-premium-vnet
Azure Virtual Network frequently asked questions (FAQ) : https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-faq#are-there-any-restrictions-on-using-ip-addresses-within-these-subnets
- 【Azure Redis 缓存】Redis导出数据文件变小 / 在新的Redis复原后数据大小压缩近一倍问题分析
- 【Azure Redis 缓存】遇见Azure Redis不能创建成功的问题:至少一个资源部署操作失败,因为 Microsoft.Cache 资源提供程序未注册。
- 【Azure Redis 缓存】当使用Azure Redis 集群服务时候,发生了Moved的几点分析
- Redis缓存穿透、缓存雪崩、redis并发问题分析
- redis sentinel & cluster 原理分析
- Redis Cluster 源码分析
- redis sentinel & cluster 原理分析
- 【Azure Redis 缓存】使用Python代码获取Azure Redis的监控指标值 (含Powershell脚本方式)
- redis-cluster核心原理分析:gossip通信、jedis smart定位、主备切换
- Memcache,Redis,MongoDB(数据缓存系统)方案对比与分析
- 【Azure Redis 缓存】Redis Geo-replication(异地复制)的问题
- 分布式缓存技术redis学习系列(五)——spring-data-redis与JedisPool的区别、使用ShardedJedisPool与spring集成的实现及一致性哈希分析
- 缓存使用中Redis,Memcached的共性和差异分析
- Memcache,Redis,MongoDB(数据缓存系统)方案对比与分析
- Redis总结(五)缓存雪崩和缓存穿透等问题 Web API系列(三)统一异常处理 C#总结(一)AutoResetEvent的使用介绍(用AutoResetEvent实现同步) C#总结(二)事件Event 介绍总结 C#总结(三)DataGridView增加全选列 Web API系列(二)接口安全和参数校验 RabbitMQ学习系列(六): RabbitMQ 高可用集群
- Nopcommerce 3.7 增加了Redis 作为缓存啦
- 【Azure Redis 缓存】Redis的指标显示CPU为70%,而Service Load却达到了100%。这两个指标意义的解释及如何缓解呢?
- Redis 缓存过期删除/淘汰策略分析
- 基于Redis分析sql实现主动缓存
- 读取memcached和redis中的数据,分析缓存数据大小