HAProxy kullanarak, 2 düğümde 6311 numaralı bağlantı noktasında çalışan Rserve (R komutlarını çağırmak için TCP soketinde dinleme hizmeti) yüklemeye çalışıyorum (TCP).HAProxy TCP trafiğini yükleme
Yapılandırma dosyam aşağıda. HAProxy'yi çalıştırdığımda, herhangi bir sorun olmadan çürütüyor. Ama dengeli düğümlere bağlandığımda, aşağıdaki hataya geçiyorum. Yapılandırmada yanlış olan bir şey var mı?
Handshake failed: expected 32 bytes header, got -1
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
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 httplog
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
listen haproxy_rserve
bind *:81
mode tcp
option tcplog
timeout client 10800s
timeout server 10800s
balance leastconn
server rserve1 rserveHostName1:6311
server rserve2 rserveHostName2:6311
listen stats proxyHostName:8080
mode http
stats enable
stats realm Haproxy\ Statistics
stats uri /haproxy_stats
stats hide-version
stats auth admin:password
yanı dengeleme önyüzü-arka uç yolu aşağıda ile çalıştı. Aynı sonuç.
frontend haproxy_rserve
bind *:81
mode tcp
option tcplog
timeout client 10800s
default_backend rserve
backend rserve
mode tcp
option tcplog
balance leastconn
timeout server 10800s
server rserve1 rserveHostName1:6311
server rserve2 rserveHostName2:6311
Merhaba - Bu çok ilginç. nginx'i neden kullanmadınız? çoğumuz nginx kullandığından, orada bir çözüm görmek çok güzel olurdu. Nginx'in tcp'yi (akış ve/veya proxy protokolünü kullanarak) desteklediğini unutmayın. – Sandeep
@Nginx'i kullanmamanız için belirli bir neden yok. Bulunan haproxy, ters proxy için özeldir ve onlarca yıldır iyi bir performans sergilemektedir ve nginx'in sunduğu (web sunucusu gibi) başka bir şeye ihtiyacım yoktur. Evet. Bunun sadece proxy kısmını kullanabiliriz. Ama sadece haproxy ile yerleşti. – Anand
@Sandeep TCP yük dengeleme örneğinin nginx uygulamasıdır. https://www.nginx.com/resources/admin-guide/tcp-load-balancing/ – Anand