Hi,

I made a little progress :) It works with more than one listen section in one 
configuration. But accessing the stats via a web browser still does not work.

My configuration file now looks like this:

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

        stats socket /tmp/haproxy_rtmp

defaults
        log global
        mode tcp
        option tcplog
        option dontlognull
        option redispatch
        option tcpka
        retries 3
        maxconn 2000
        contimeout 10000
        clitimeout 50000
        srvtimeout 50000

        stats enable

listen http :80
        mode tcp
        balance roundrobin

        server h1 xxx.xxx.xxx.xxx:80 check
        server h2 xxx.xxx.xxx.xxx:80 check

listen rtmp :1935
        mode tcp
        balance roundrobin

        server s1 xxx.xxx.xxx.xxx:1935 check
        server s2 xxx.xxx.xxx.xxx:1935 check

listen stats :81
        mode http

        stats enable
        stats hide-version
        stats scope   .
        stats uri /admin?stats
        stats realm  Haproxy\ Statistics
        stats auth xxx:xxx

Regards
Jan

Am 11.08.2010 um 13:42 schrieb Duncan Hall:

You are running the load balancer in TCP mode and not http mode.

Thats OK, but you need to set up a section for it the config for http mode.

Try adding this to your haproxy.cfg (replace 192.168.123.1 with your
servers IP address):

# LOCAL HAProxy stats #

listen  stats   192.168.123.1:80
        mode            http
        log             global

        maxconn 10

        clitimeout      10s
        srvtimeout      10s
        contimeout      10s
        timeout queue   10s

        #Stats page eg http://192.168.123.1:80/haproxy?stats
        stats enable
        stats refresh 30s
        stats show-node
        stats show-legends
        stats show-desc
stats auth letme:in
        stats uri  /haproxy?stats


Regards,

Duncan




On 11/08/2010 8:57 PM, [email protected]<mailto:[email protected]> wrote:
Hi,

I can't figure out how to set up stats for HAProxy.

This is my configuration:

|global
       log127.0.0.1  local0
       log127.0.0.1  local1 notice
       daemon
       #debug
       user haproxy
       group  haproxy
       maxconn4096

       stats socket/tmp/haproxy

defaults
       logglobal
       mode tcp
       option tcplog
       option dontlognull
       option redispatch
       retries3
       maxconn2000
       contimeout10000
       clitimeout50000
       srvtimeout50000

       stats enable
       stats hide-version
       stats scope.
       stats realmHaproxy\  Statistics
       stats uri/haproxy?stats
       stats auth xxxxx:xxxxx

       option contstats

listen rtmp:1935
       mode tcp
       balance roundrobin

       server s1 xxx.xxx.xxx.xxx:1935  check
       server s2 xxx.xxx.xxx.xxx:1935  check
|

I can access the stats with socat but *not* with a web browser. As far
as I understand the manual there should be a stats page available via
http://mysite/haproxy?stats. What am I missing?

Regards
Jan


Jan Deinhard

Software Developer

UJAM GmbH
Speicher 1
Konsul-Smidt-Str 8d
28217 Bremen

fon  +49 421 89 80 97 0

[email protected]<mailto:[email protected]>
www.ujam.com<http://www.ujam.com/>



Reply via email to