rabbitmq 集群 ha负载 Consumer raised exception, processing can restart if the connection factory
情況是醬紫滴
線上有一個rabbitmq 集群,一臺磁盤模式的 兩臺內存模式的. 使用erlang 做cookie 做同步.haproxy做負載
在連接一會后 程序拋出異常 Consumer raised exception, processing can restart if the connection factory
原因是因為ha 在做負載的時候 設置玩tcp連接后 還需要把默認的 timeout server 和 timeout client 注釋掉.
這樣ha就不會自動的關閉mq的tcp 長連接了
華麗的分割線_____________________________________________________________________
global
log 127.0.0.1 local3
maxconn 65535 #這里可以改大一些 增加擴容
chroot /usr/local/haproxy
uid nobody
gid nobody
daemon
nbproc 1
pidfile /usr/local/haproxy/haproxy.pid
#debug
#tune.ssl.default-dh-param 2048
defaults
log 127.0.0.1 local3
#mode tcp
option tcplog
#option http-server-close
option dontlognull
option forwardfor
option redispatch
retries 2
maxconn 3000 #這里可以改大一些 增加擴容
timeout connect 5000
#timeout client 100000 將此行注釋
#timeout server 100000 將此行注釋
listen web_ha
bind 0.0.0.0:9999
mode http
transparent
stats refresh 30s
stats uri /haproxy-stats
stats hide-version
stats realm Haproxy\statistics
stats auth :*
listen rabbitmq_cluster 0.0.0.0:5670
mode tcp
option tcplog
option tcpka #允許發送tcp 長連接
log global
balance roundrobin
#cookie rabbit insert indirect nocache
#server rabbitmq-1 192.168.8.114:5672 weight 2 check inter 2000 rise 1 fall 5
server rabbitmq-2 192.168.8.115:5672 check inter 5000
server rabbitmq-3 192.168.8.116:5672 check inter 5000
總結
以上是生活随笔為你收集整理的rabbitmq 集群 ha负载 Consumer raised exception, processing can restart if the connection factory的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 到底什么是空指针?如何避免空指针_01
- 下一篇: Mybatis-plus 大数据量数据流