emqx 集群搭建
例如:
mqtt集群搭建并使用nginx做负载均衡_亲测得结论
示例:
vim /etc/nginx/nginx.conf http { } #在http外添加如下配置 stream { upstream stream_backend { zone tcp_servers 64k; hash $remote_addr; server 192.168.1.17:1883 max_fails=2 fail_timeout=30s; server 192.168.1.18:1883 max_fails=2 fail_timeout=30s; server 192.168.1.19:1883 max_fails=2 fail_timeout=30s; } server { listen 8883 ssl; status_zone tcp_server; proxy_pass stream_backend; proxy_buffer_size 4k; ssl_handshake_timeout 15s; ssl_certificate /etc/emqx/certs/cert.pem; ssl_certificate_key /etc/emqx/certs/key.pem; } }
参考链接:
https://docs.emqx.cn/enterprise/v4.3/tutorial/deploy.html#%E7%A7%81%E6%9C%89%E7%BD%91%E7%BB%9C%E9%83%A8%E7%BD%B2
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)