2017-09-08 5 views
0

websocketロードバランスとRabbitMQロードバランシングを可能にするhaproxy(HAProxyバージョン1.5.18)の設定を探しています。私は多くのオプションを試してみましたが、どれも以下、動作するようには思えない私のhaproxy設定ファイルです:Haproxy Sockjs Websocket loadbalancingとRabbitMQのロードバランシングを同じ設定で

global 
     log   127.0.0.1 local2 

     chroot  /var/lib/haproxy 
     pidfile  /var/run/haproxy.pid 
     maxconn  4000 
     user  haproxy 
     group  haproxy 
     daemon 

     stats socket /var/lib/haproxy/stats 

    defaults 
     mode     http 
     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 15s 
     timeout queue   1m 
     timeout connect   10s 
     timeout client   1m 
     timeout server   1m 
     timeout http-keep-alive 10s 
     timeout check   10s 
     maxconn     3000 
     timeout tunnel   3600s 

    frontend http_web *:80 
     mode http 
     default_backend rgw 

    backend rgw 
     balance roundrobin 
     server rgw1 173.36.22.49:8080 maxconn 10000 weight 10 cookie rgw1 check 
     server rgw2 10.42.139.69:8080 maxconn 10000 weight 10 cookie rgw2 check 

    listen stats :9000 
     mode http 
     stats enable 
     stats realm Haproxy\ Statistics 
     stats uri /haproxy_stats # Stats URI 
     stats auth websocketadmin:websocketadmin 

    listen ampq 
     bind *:61613 
     mode tcp 
     option clitcpka 
     server rabbit1 10.42.6.112:61613 check inter 1s rise 3 fall 1 
     server rabbit2 10.42.6.113:61613 check inter 1s rise 3 fall 1 
     server rabbit3 10.42.6.114:61613 check inter 1s rise 3 fall 1 
     server rabbit4 10.42.6.115:61613 check inter 1s rise 3 fall 1 

Haproxyは、すべてのエラーを与えるものではありません、それは以下のメッセージを出力しますが、それは動作しません、私はに接続できませんwebsocketまたはRabbitmqに接続します。 しかし、 "listen ampq"を削除するとすぐに、すべてがうまく動作し始めます。

Sep 8 21:00:40 localhost haproxy[3184]: Proxy http_web started. 
    Sep 8 21:00:40 localhost haproxy[3184]: Proxy rgw started. 
    Sep 8 21:00:40 localhost haproxy[3184]: Proxy stats started. 

答えて

0

問題が既に別のプロセスによって撮影されたポート61613でした。だから私は新しいポートに変更してファイアウォールルールに追加しなければならなくなりました。

関連する問題