![HAProxy 路由在不同端口上运行的应用程序](https://linux22.com/image/695708/HAProxy%20%E8%B7%AF%E7%94%B1%E5%9C%A8%E4%B8%8D%E5%90%8C%E7%AB%AF%E5%8F%A3%E4%B8%8A%E8%BF%90%E8%A1%8C%E7%9A%84%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F.png)
嗨,我正在尝试配置 HAProxy,但遇到了一些麻烦。我们有一台服务器运行两个应用程序(odoomexy、odoopepess),其中一个通过端口 8069 运行,另一个通过端口 8070 运行。目前,我们使用 ipserver:8069 和 ipserver:8070 访问这些应用程序,但我们遇到了响应缓慢和许多连接错误。这是 haproxy.cfg:
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
defaults
log global
option dontlognull
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000
listen appname 0.0.0.0:80
mode http
stats enable
stats uri /haproxy?stats
stats realm Strictly\ Private
stats auth A_Username:odoo
stats auth Another_User:foo
balance roundrobin
option httpclose
option forwardfor
backend odoo_mexy
server odoomexy 127.0.0.1:8069 check
backend odoo_pepess
server odoopepess 127.0.0.1:8070 check
frontend odoo_IN
bind 127.0.0.1:8090
bind 127.0.0.1:8091
mode tcp
option tcplog
option tcpka
timeout client 60m
timeout server 60m
timeout http-keep-alive 1m
acl d1 dst_port 8090
use_backend odoo_mexy if d1
acl d2 dst_port 8091
use_backend odoo_pepess if d2
我收到了这个错误日志:
* Starting haproxy
[WARNING] 356/120356 (18401) : parsing [/etc/haproxy/haproxy.cfg:43] : server timeout will be ignored because frontend 'odoo_IN' has no backend capability
[WARNING] 356/120356 (18402) : parsing [/etc/haproxy/haproxy.cfg:43] : server timeout will be ignored because frontend 'odoo_IN' has no backend capability
[ALERT] 356/120356 (18402) : Starting proxy appname: cannot bind socket
任何帮助都将不胜感激!