Hello Igor,

Le lun. 16 déc. 2019 à 23:41, Igor Cicimov <ig...@encompasscorporation.com>
a écrit :

> Hi,
>
> On Tue, Dec 17, 2019 at 2:55 AM Olivier D <webmas...@ajeux.com> wrote:
>
>> Hello,
>>
>> I found what was wrong : I was using "load-server-state-from-file" and
>> previous config file was using port 80 as server port.
>> It seems using this instruction loads previous server state but also
>> previous srv_port.
>> Is this an expected behaviour ?
>>
>
> Yes, basically it is your responsibility to dump the current state into
> the file otherwise you'll gate outdated data as you noticed. For example I
> add:
>
> ExecReload=/bin/echo "show servers state" | /usr/bin/socat stdio
> /run/haproxy/admin.sock > /var/lib/haproxy/state
>
> in the systemd service file.
>

That's not what I was saying. I'm already using "show server state", and
that's exactly what leads me to hours of debugging : between two versions
of my haproxy config file, I changed backend server port from 80 to 443.
When HAProxy reloaded, it loaded server state file and loaded both the
previous state(up/down) of the server, but also the server port. That's why
HAProxy never used port 443 as backend port and was still using old port 80.
This is not clearly stated in the configuration (or maybe I missed it ?),
that's why I was asking whether it is an expected behaviour. In my mind,
the server state was only used to get server status between two reload, not
more informations.

Olivier

Reply via email to