Re: stats socket problem

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 22 Jan 2009 07:42:16 +0100


On Thu, Jan 22, 2009 at 01:01:56AM +0100, Martin Karbon wrote:
> Quoting Willy Tarreau <w#1wt.eu>:
>
> >On Wed, Jan 21, 2009 at 09:43:58PM +0100, Martin Karbon wrote:
> >>Quoting Willy Tarreau <w#1wt.eu>:
> >>
> >>Hi Willy, thanks for the fast reply
> >>>Hi Martin,
> >>>
> >>>On Wed, Jan 21, 2009 at 12:13:35PM +0100, Martin Karbon wrote:
> >>>>Hi
> >>>>I am relatively new to this great software and I am having problems
> >>>>with the feature stats socket. it won't write the haproxy.stat file no
> >>>>matter what. so I cannot run the "socat".
> >>>>root#lb1:~# echo "show stat" | socat unix-connect:/var/run/haproxy.stat
> >>>>stdio
> >>>>2009/01/21 12:12:54 socat[4887] E connect(3, AF=1
> >>>>"/var/run/haproxy.stat", 23): No such file or directory
> >>>>I wanted to try to write some script that checks the connection
> >>>>distribution every n seconds (i.e.for a monitoring tool)... any advice
> >>>>for this?
> >>>
> >>>I see nothing wrong in your config. It's so simple! Could you check a
> >>>few things, such as if something already exists in /var/run, if you see
> >>>a symbolic link or anything like this which might explain such a strange
> >>>behaviour.
> >>
> >>As far as I can see no symbolic link in here...just pid files and some
> >>dirs
> >>
> >>>Also, it would be nice if you could start haproxy under strace :
> >>>
> >>># strace -o /tmp/haproxy-start.log haproxy -db -f /etc/haproxy.cfg
> >>>
> >>>Then press Ctrl-C after a few seconds, and look for "haproxy.stat"
> >>>in the output file (or post the result here). I think we'll find
> >>>the reason there. There must be an error somewhere, or there is
> >>>something disabling the stats but I don't see what can do that.
> >>>
> >>>Regards,
> >>>Willy
> >>
> >>here is the output of the strace (note: this is a virtual machine I
> >>have at home, same installation as the "original" one)
> >
> >(...)
> >
> >now that's rather intriguing. There's no trace of the socket at all.
> >Just as if the "stats" line was ignored.
> >
> >What version of haproxy do you have ? (haproxy -vv)
>
> root#lobalix01:/etc# haproxy -vv
> HA-Proxy version 1.3.12 2007/06/17

Funny, as the stats socket was implemented later (was added in 1.3.13 on the 2007/10/17). So I think that the config parser was not strict enough and did not catch this "stats" keyword. That seems strange, but it appears to be the case. Another possibility is that your package includes some backports of later versions which in fact do not work.

(...)
> you thinking the version being the problem ? This is the version I get
> from ubuntus repositories ...

Yes I think the problem is with this version. I find it strange that Ubuntu still has that old version, as other distros have migrated to 1.3.14 or 1.3.15. You should rebuild it from the latest sources (1.3.15.7), it's not too hard. Just "make TARGET=linux26" and you're OK.

Alternatively, you can download a pre-compiled binary from the haproxy site (/download/1.3/bin/).

Regards,
Willy Received on 2009/01/22 07:42

This archive was generated by hypermail 2.2.0 : 2009/01/22 07:45 CET