Chúng tôi đã thiết lập 3 máy chủ:HAProxy ngẫu nhiên HTTP 503 lỗi
- máy chủ A với Nginx + HAproxy để thực hiện cân bằng
- backend server B
- máy chủ backend C
đây tải là của chúng tôi /etc/haproxy/haproxy.cfg
:
global
log /dev/log local0
log 127.0.0.1 local1 notice
maxconn 40096
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
contimeout 50000
clitimeout 50000
srvtimeout 50000
stats enable
stats uri /lb?stats
stats realm Haproxy\ Statistics
stats auth admin:admin
listen statslb :5054 # choose different names for the 2 nodes
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri/
stats auth admin:admin
listen Server-A 0.0.0.0:80
mode http
balance roundrobin
cookie JSESSIONID prefix
option httpchk HEAD /check.txt HTTP/1.0
server Server-B <server.ip>:80 cookie app1inst2 check inter 1000 rise 2 fall 2
server Server-C <server.ip>:80 cookie app1inst2 check inter 1000 rise 2 fall 3
Tất cả ba máy chủ có một số lượng tốt của RAM và CPU lõi để xử lý yêu cầu
HTTP ngẫu nhiên 503 lỗi được hiển thị khi duyệt: 503 Service Unavailable - No server is available to handle this request.
Và cũng trên giao diện điều khiển của máy chủ:
Message from [email protected] at Dec 21 18:27:20 ...
haproxy[1650]: proxy Server-A has no server available!
Note 90% thời gian không có lỗi. Những lỗi này xảy ra ngẫu nhiên.
Bạn đã bao giờ tìm thấy câu trả lời chưa? Chúng tôi có một cái gì đó tương tự. – jeesty
Tìm câu trả lời ... Vui lòng chấp nhận câu trả lời. – Siten