Op do 14 dec. 2017 om 22:12 schreef PiBa-NL <[email protected]>

> Hi Johan,
>
> Op 14-12-2017 om 9:35 schreef Johan Hendriks:
> > Op 13/12/2017 om 20:48 schreef PiBa-NL:
> >> Hi Johan,
> >>
> >> Op 13-12-2017 om 17:31 schreef Johan Hendriks:
> >>> When i use the show stat command I get different results?
> >> Just a guess, are you using?: nbproc > 1
> > Yes indeed i use nbproc > 1, There are no old processes running on the
> > machine.
> > This is my global config
> >
> > global
> >          nbproc          8
> >
> > #        stats bind-process 1
> Oke so 'uncommenting' this 'fixed' the issue that you set a server to
> maintenance state in the first haproxy process, and you are viewing the
> 'show stat' of that first process..
> >          stats socket /var/run/haproxy/info.sock mode 600 level admin
> >          log 127.0.0.1:514 local1 notice
> >
> > defaults
> >          log     global
> >          mode    http
> >
> > listen stats
> > bind :8077
> perhaps you would like to bind this port also to the first process.? so
> webgui will show the state also of the first PID.?
> >     mode http
> >     stats enable
> >     stats scope web-backend
> >     stats uri /
> >     stats realm Haproxy\ Statistics
> >
> >
> > I just saw that I commented out stats bind-process 1
> > I did uncomment it and it seems to be working now for the echo "show
> > stat" | socat /var/run/haproxy/info.sock stdio part, it is not switching
> > to UP sometimes, but the web GUI is showing the server is UP. It did
> > show it in maintenance mode first but after a while it shows UP instead
> > of maintenance.
> >
> >
> > Thank you very much for your time.
> > regards
> > Johan
> >
> However.!
>
> If youve understood how nbproc works, it just means haproxy gets started
> several times simultaneously and each keeps its own state. That means
> you need to configure 8 separate stats sockets, and 8 stats websites,
> and when setting a server to maintenance you need to make sure all 8
> process are set to this new state.
>
> In your current config visit the stats page and press ctrl+F5 several
> times in the browser(firefox?), youl see the pid on the stats page
> change, and also if your 'lucky' you might see the server sometimes is
> in maintenance mode when you by chance are requesting the stats page of
> the same process / PID you changed that state on..
>
> Anyhow.. i don't have a example ready myself but have seen some pass on
> the mailinglist how to configure multiple sockets for this.. Hope above
> comments gets you going in the right idea :)
>
> Regards,
>
> PiBa-NL
>
Thanks, I found out that each proces has its own metrics and can be
controlled seperately using a unix socket.
I have configured haproxy now in a way every proces has its own .sock file
which i can control, and read metrics from.
Reading the web I learned a lot about the proces. Also the option to chain
a frontend to a proces is something i did not know, which  makes separating
metrics from different frontends simpler.

Thank you for pushing me in the right direction.
I will reply to this thread with my config. So other people can use that as
an example. I am on a mobile device now, so no acces to the box.

Regards
Johan

Reply via email to