Haproxy-Konfigurationsfehler


12

Hier ist meine Konfiguration

global
        log /dev/log   local0
        log 127.0.0.1   local1 notice
        maxconn 4096
        user haproxy
        group haproxy
        daemon

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        retries 3
        option redispatch
        maxconn 2000
        contimeout     5000
        clitimeout     50000
        srvtimeout     50000

listen webfarm 0.0.0.0:80
    mode http
    stats enable
    stats uri /haproxy?stats
    balance roundrobin
    option httpclose
    option forwardfor
    server apache 192.168.1.10:8001 weight 1  maxconn 512 check

Nach der Konfiguration habe ich den Haproxy-Dienst neu gestartet und die folgende Meldung erhalten

root@d32b2eb97bf0:/# service haproxy start
 * Starting haproxy haproxy                                                                                                        [WARNING] 144/130034 (436) : parsing [/etc/haproxy/haproxy.cfg:17] : the 'contimeout' directive is now deprecated in favor of 'timeout connect', and will not be supported in future versions.
[WARNING] 144/130034 (436) : parsing [/etc/haproxy/haproxy.cfg:18] : the 'clitimeout' directive is now deprecated in favor of 'timeout client', and will not be supported in future versions.
[WARNING] 144/130034 (436) : parsing [/etc/haproxy/haproxy.cfg:19] : the 'srvtimeout' directive is now deprecated in favor of 'timeout server', and will not be supported in future versions.
[ALERT] 144/130034 (436) : parsing [/etc/haproxy/haproxy.cfg:21] : 'listen' cannot handle unexpected argument '0.0.0.0:80'.
[ALERT] 144/130034 (436) : parsing [/etc/haproxy/haproxy.cfg:21] : please use the 'bind' keyword for listening addresses.
[ALERT] 144/130034 (436) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[WARNING] 144/130034 (436) : config : proxy 'webfarm' has no 'bind' directive. Please declare it as a backend if this was intended.
[WARNING] 144/130034 (436) : config : missing timeouts for proxy 'webfarm'.
   | While not properly invalid, you will certainly encounter various problems
   | with such a configuration. To fix this, please ensure that all following
   | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
[ALERT] 144/130034 (436) : Fatal errors found in configuration.

Ich habe oben Schritte im Docker-Container gemacht. Wie zu reslove?

Vielen Dank.

Antworten:


29

Die Syntax hat sich in der letzten HAProxy-Version geändert. Ich hatte dieses Problem in Version 1.6.5:

Veränderung: listen webfarm 0.0.0.0:80

Zu:

listen webfarm

bind 0.0.0.0:80

Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.