【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.
参考资料
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
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
2021-03-22 【Azure 应用程序见解】在Azure门户中,创建App Service(应用服务)时,无法一起创建Application Insights的问题