Dựa trên phân tích và tình huống bạn đã mô tả, có hai giải pháp chính để khắc phục vấn đề liên quan đến NLB internal và sự ổn định của kết nối:
Giải Pháp 1: Bật Cross-Zone Load Balancing
Đây là giải pháp đơn giản nhất và hiệu quả nhất trong trường hợp này. Khi bật tính năng cross-zone load balancing, các yêu cầu từ AZ không có pods sẽ được chuyển hướng đến các AZ khác có pods, đảm bảo rằng tất cả kết nối đều hoạt động ổn định.
Cách thực hiện:
-
Sử dụng lệnh AWS CLI:
shell1aws elbv2 modify-load-balancer-attributes \ 2 --load-balancer-arn arn:aws:elasticloadbalancing:ap-northeast-1:xxx:loadbalancer/net/... \ 3 --attributes Key=load_balancing.cross_zone.enabled,Value=true -
Hoặc trong Terraform:
hcl1resource "aws_lb" "rabbitmq_nlb" { 2 name = "rabbitmq-internal" 3 internal = true 4 load_balancer_type = "network" 5 enable_cross_zone_load
Read the full article at DEV Community
Want to create content about this topic? Use Nemati AI tools to generate articles, social posts, and more.

![[AINews] The Unreasonable Effectiveness of Closing the Loop](/_next/image?url=https%3A%2F%2Fmedia.nemati.ai%2Fmedia%2Fblog%2Fimages%2Farticles%2F600e22851bc7453b.webp&w=3840&q=75)



