Welcome! Log In Create A New Profile

Advanced

Only start on CentOS7 in debug...

Posted by Geert Van Muylem 
Geert Van Muylem
Only start on CentOS7 in debug...
April 09, 2018 09:00PM
Hi,


I've downloaded and compiled haproxy version 1.8.7 on CentOS7

(make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1)


The proxy only starts as it should be if I add the "-d"


My haproxy.service


[Unit]

Description=HAProxy Load Balancer

After=syslog.target network.target


[Service]

EnvironmentFile=/etc/sysconfig/haproxy

ExecStart=/usr/sbin/haproxy -d -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS

ExecReload=/bin/kill -USR2 $MAINPID

KillMode=mixed


[Install]

WantedBy=multi-user.target


"/usr/lib/systemd/system/haproxy.service" 12L, 303C

OK -> with -d
---------

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: epoll : pref=300, test result OK

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: poll : pref=200, test result OK

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: select : pref=150, test result FAILED

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Total: 3 (2 usable), will use epoll.

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Available filters :

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [SPOE] spoe

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [COMP] compression

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [TRACE] trace

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Proxy http_back started.

Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Proxy http_back started.

I can see the stats and the requests are forwarded to the first server...(second is not yet configured)


NOK -> without -d

------

Apr 09 20:46:38 haproxy.doom.be systemd[1]: Stopping HAProxy Load Balancer....

Apr 09 20:46:38 haproxy.doom.be systemd[1]: Started HAProxy Load Balancer.

Apr 09 20:46:38 haproxy.doom.be systemd[1]: Starting HAProxy Load Balancer....


global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
#group haproxy
daemon

defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000

frontend http_front
bind *:80
stats uri /haproxy?stats
default_backend http_back

backend http_back
balance roundrobin
server BERT 10.10.8.30:80 check
server ERNIE 10.10.8.31:80 check
"/etc/haproxy/haproxy.cfg" 27L, 504C


Thanks
Geert
Attachments:
open | download - Screenshot from 2018-04-09 20-51-07.png (88.8 KB)
Aleksandar Lazic
Re: Only start on CentOS7 in debug...
April 09, 2018 09:30PM
Hi Geert.

Am 09.04.2018 um 20:54 schrieb Geert Van Muylem:
> Hi,
>
>
> I've downloaded and compiled haproxy version 1.8.7 on CentOS7
>
> (make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1)
>
>
> The proxy only starts as it should be if I add the "-d"
>
> My haproxy.service
>
>
> [Unit]
> Description=HAProxy Load Balancer
> After=syslog.target network.target
>
> [Service]
> EnvironmentFile=/etc/sysconfig/haproxy
> ExecStart=/usr/sbin/haproxy -d -f /etc/haproxy/haproxy.cfg -p
> /run/haproxy.pid $OPTIONS
> ExecReload=/bin/kill -USR2 $MAINPID
> KillMode=mixed
>
> [Install]
> WantedBy=multi-user.target
> "/usr/lib/systemd/system/haproxy.service" 12L, 303C

https://cbonte.github.io/haproxy-dconv/1.8/management.html#3

I suggest to use `-db` instead of `-d` , but what's the reason why you
don't try the included systemd file?

http://git.haproxy.org/?p=haproxy-1.8.git;a=blob;f=contrib/systemd/haproxy.service.in;h=7a8b6bead2df23bc4e16e8edddfd0aacde454572;hb=HEAD

There is also a nice Makefile to create a working systemd file ;-)

http://git.haproxy.org/?p=haproxy-1.8.git;a=tree;f=contrib/systemd;hb=HEAD

Regards
Aleks

> OK -> with -d
> ---------
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: epoll : pref=300,  test
> result OK
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: poll : pref=200,  test
> result OK
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: select : pref=150,  test
> result FAILED
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Total: 3 (2 usable), will
> use epoll.
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Available filters :
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [SPOE] spoe
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [COMP] compression
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [TRACE] trace
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Proxy http_back started.
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Proxy http_back started.
>
> I can see the stats and the requests are forwarded to the first
> server...(second is not yet configured)
>
>
> NOK -> without -d
>
> ------
>
> Apr 09 20:46:38 haproxy.doom.be systemd[1]: Stopping HAProxy Load
> Balancer...
>
> Apr 09 20:46:38 haproxy.doom.be systemd[1]: Started HAProxy Load Balancer.
>
> Apr 09 20:46:38 haproxy.doom.be systemd[1]: Starting HAProxy Load
> Balancer...
>
>
>
> global
>    log /dev/log local0
>    log /dev/log local1 notice
>    chroot /var/lib/haproxy
>    stats timeout 30s
>    user haproxy
>    #group haproxy
>    daemon
>
> defaults
>    log global
>    mode http
>    option httplog
>    option dontlognull
>    timeout connect 5000
>    timeout client 50000
>    timeout server 50000
>
> frontend http_front
>    bind *:80
>    stats uri /haproxy?stats
>    default_backend http_back
>
> backend http_back
>    balance roundrobin
>    server BERT 10.10.8.30:80 check
>    server ERNIE 10.10.8.31:80 check
> "/etc/haproxy/haproxy.cfg" 27L, 504C
>
>
> Thanks
> Geert
Geert Van Muylem
Re: Only start on CentOS7 in debug...
April 09, 2018 09:50PM
Hi Aleks,


I've recompiled with

make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_SYSTEMD=1


And used the system file as you proposed... (The -Ws gave a problem when compiling without USE_SYSTEMD)


It seems to work!


Thanks


Only when stopping the service:

Should I worry about the last 2 messages?



Apr 9 21:44:13 haproxy systemd: Stopping HAProxy Load Balancer...

Apr 9 21:44:13 haproxy haproxy: [WARNING] 098/214408 (8092) : Exiting Master process...

Apr 9 21:44:13 haproxy haproxy: [ALERT] 098/214408 (8092) : Current worker 8097 exited with code 143

Apr 9 21:44:13 haproxy haproxy: [WARNING] 098/214408 (8092) : All workers exited. Exiting... (143)

Apr 9 21:44:13 haproxy systemd: haproxy.service: main process exited, code=exited, status=143/n/a

Apr 9 21:44:13 haproxy systemd: Stopped HAProxy Load Balancer.

Apr 9 21:44:13 haproxy systemd: Unit haproxy.service entered failed state.

Apr 9 21:44:13 haproxy systemd: haproxy.service failed.


Geert

________________________________
From: Aleksandar Lazic <[email protected]>
Sent: Monday, April 9, 2018 9:17 PM
To: Geert Van Muylem; haproxy@formilux.org
Subject: Re: Only start on CentOS7 in debug...

Hi Geert.

Am 09.04.2018 um 20:54 schrieb Geert Van Muylem:
> Hi,
>
>
> I've downloaded and compiled haproxy version 1.8.7 on CentOS7
>
> (make TARGET=linux2628 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1)
>
>
> The proxy only starts as it should be if I add the "-d"
>
> My haproxy.service
>
>
> [Unit]
> Description=HAProxy Load Balancer
> After=syslog.target network.target
>
> [Service]
> EnvironmentFile=/etc/sysconfig/haproxy
> ExecStart=/usr/sbin/haproxy -d -f /etc/haproxy/haproxy.cfg -p
> /run/haproxy.pid $OPTIONS
> ExecReload=/bin/kill -USR2 $MAINPID
> KillMode=mixed
>
> [Install]
> WantedBy=multi-user.target
> "/usr/lib/systemd/system/haproxy.service" 12L, 303C

https://cbonte.github.io/haproxy-dconv/1.8/management.html#3
HAProxy version 1.8.5 - Management Guide - cbonte.github.io<https://cbonte.github.io/haproxy-dconv/1.8/management.html#3>;
cbonte.github.io
HAProxy is a single-threaded, event-driven, non-blocking daemon. This means is uses event multiplexing to schedule all of its activities instead of relying on the system to schedule between multiple activities.




I suggest to use `-db` instead of `-d` , but what's the reason why you
don't try the included systemd file?

http://git.haproxy.org/?p=haproxy-1.8.git;a=blob;f=contrib/systemd/haproxy.service.in;h=7a8b6bead2df23bc4e16e8edddfd0aacde454572;hb=HEAD

There is also a nice Makefile to create a working systemd file ;-)

http://git.haproxy.org/?p=haproxy-1.8.git;a=tree;f=contrib/systemd;hb=HEAD

Regards
Aleks

> OK -> with -d
> ---------
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: epoll : pref=300, test
> result OK
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: poll : pref=200, test
> result OK
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: select : pref=150, test
> result FAILED
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Total: 3 (2 usable), will
> use epoll.
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Available filters :
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [SPOE] spoe
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [COMP] compression
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: [TRACE] trace
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Proxy http_back started.
>
> Apr 09 20:43:32 haproxy.doom.be haproxy[3935]: Proxy http_back started.
>
> I can see the stats and the requests are forwarded to the first
> server...(second is not yet configured)
>
>
> NOK -> without -d
>
> ------
>
> Apr 09 20:46:38 haproxy.doom.be systemd[1]: Stopping HAProxy Load
> Balancer...
>
> Apr 09 20:46:38 haproxy.doom.be systemd[1]: Started HAProxy Load Balancer..
>
> Apr 09 20:46:38 haproxy.doom.be systemd[1]: Starting HAProxy Load
> Balancer...
>
>
>
> global
> log /dev/log local0
> log /dev/log local1 notice
> chroot /var/lib/haproxy
> stats timeout 30s
> user haproxy
> #group haproxy
> daemon
>
> defaults
> log global
> mode http
> option httplog
> option dontlognull
> timeout connect 5000
> timeout client 50000
> timeout server 50000
>
> frontend http_front
> bind *:80
> stats uri /haproxy?stats
> default_backend http_back
>
> backend http_back
> balance roundrobin
> server BERT 10.10.8.30:80 check
> server ERNIE 10.10.8.31:80 check
> "/etc/haproxy/haproxy.cfg" 27L, 504C
>
>
> Thanks
> Geert
Sorry, only registered users may post in this forum.

Click here to login