セットアップ方法に関するアドバイスが必要ですハプロキシです。私は2つのWebサーバーを稼働させています。レイヤ4「接続が拒否されました」とハプロキシ
$> /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg
[WARNING] 325/202628 (16) : Server node-backend/server-a is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 325/202631 (16) : Server node-backend/server-b is DOWN, reason: Layer4 timeout, check duration: 2001ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 325/202631 (16) : backend 'node-backend' has no server available!
ただ1つの注:テストのために、彼らは、私は次のように私を与えるhaproxy開始私のhaproxyサーバー上の今
ポート8080上の簡単なノードサーバを実行私が行う場合:
haproxy$> wget server-a:8080
私はノードサーバーから応答を受け取ります。私は動作しているようですcheck
オプションを削除した場合
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode tcp
log global
option tcplog
option dontlognull
option http-server-close
# option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend www
bind *:80
default_backend node-backend
#---------------------------------------------------------------------
# round robin balancing between the various backends
#--------------------------------------------------------------------
backend node-backend
balance roundrobin
mode tcp
server server-a 172.19.0.2:8080 check
server server-b 172.19.0.3:8080 check
:
は、ここに私のhaproxy.cfgです。どのように私はこのhaproxyのメカニズムを確認することができますどのような提案?
私はL4が正確には何tcp' 'モードを使用して設定されているのに。 L4とL7の正確な定義は? –
L4はレイヤ4チェック(OSIモデル)です.L7はレイヤ7チェックです。L4はステータスコード500,404,200,301 ...などで返信します。 L7はリクエストによって返された "Content"を見ます... httpヘッダ、json文字列、結果の本文の中身 –