Hello !

Sorry for the subject of my email.
Sometimes, I have some understanding concern in English.

So you want all the configuration of HAProxy ? You can look at the attachment (haproxy.cfg). I have just used the basic configuration of HAProxy. And I have forgotten to mention the version of HAProxy (maybe there are some differences) : HA-Proxy version 1.8.19-1+deb10u2 2020/04/01.

Also, sorry for the asterisks they seems to be added after my sending. :/

You can see the logs after a restart and some exchange of data.
I have seen that when I change the configuration of my IoT device to a sending interval of 30 seconds instead of 15 minutes or 30 minutes, HAProxy works and exchanges between my device and my java server seems to be made normally. So maybe, it's a problem of timeout.


Also, you can see in the log file, these two last lines :

   Aug 11 11:24:30 AS-Freedom haproxy[5371]: 185.99.26.70:60749
   [11/Aug/2020:11:22:12.639] srv_java all_java_srv/srv_1 1/0/138128 17
   cD 1/1/0/0/0 0/0
   Aug 11 11:27:36 AS-Freedom haproxy[5371]: 185.99.26.66:49655
   [11/Aug/2020:11:26:45.595] srv_java all_java_srv/srv_1 1/0/50755 5
   cD 1/1/0/0/0 0/0

I think they should be appearing when the connection is interrupted between the server and the device is interrupted.

I will search again about timeouts in HAProxy.

Thanks a lot for your help !
And sorry for the lack of information.
Sincerely.


Le 11/08/2020 à 00:00, Tim Düsterhus a écrit :
Axel,

Am 10.08.20 um 19:02 schrieb Axel DUMAS:
Can I ask my question here ? Or do I have to write it in an other place ?
This is the appropriate place. However I must admit that your email
looked like spam based off the Subject at a first glance.

In order to test load-balancing, in the config file of HAProxy, I wrote
theses two things :
*frontend* java_srv
*bind* 192.168.0.19:26001
*mode* tcp
*default_backend* all_java_srv

*backend* all_java_srv
*balance* roundrobin
*mode* tcp
*server* srv_1 192.168.0.19:26001
Can you please give your *literal* configuration instead of just the
options you consider important? And please give the configuration in the
original format without the asterisks in there.

Some fast exchanges seems to be made between the IoT device and my
server, but when it have to wait, the connection is cut and the device
is disconnected.
Any error messages? Did you enable logging in HAProxy (you should)? Can
you provide a log message?

Best regards
Tim Düsterhus
Aug 11 11:20:34 AS-Freedom haproxy[5188]: [WARNING] 223/111742 (5188) : Exiting Master process...
Aug 11 11:20:34 AS-Freedom haproxy[5188]: [ALERT] 223/111742 (5188) : Current worker 5189 exited with code 143
Aug 11 11:20:34 AS-Freedom haproxy[5188]: [WARNING] 223/111742 (5188) : All workers exited. Exiting... (143)
Aug 11 11:20:34 AS-Freedom haproxy[5370]: [WARNING] 223/112034 (5370) : parsing [/etc/haproxy/haproxy.cfg:26] : 'option httplog' not usable with frontend 'srv_java' (needs 'mode http'). Falling back to 'option tcplog'.
Aug 11 11:20:34 AS-Freedom haproxy[5370]: Proxy srv_java started.
Aug 11 11:20:34 AS-Freedom haproxy[5370]: Proxy srv_java started.
Aug 11 11:20:34 AS-Freedom haproxy[5370]: Proxy all_java_srv started.
Aug 11 11:20:34 AS-Freedom haproxy[5370]: Proxy all_java_srv started.
Aug 11 11:24:30 AS-Freedom haproxy[5371]: 185.99.26.70:60749 [11/Aug/2020:11:22:12.639] srv_java all_java_srv/srv_1 1/0/138128 17 cD 1/1/0/0/0 0/0
Aug 11 11:27:36 AS-Freedom haproxy[5371]: 185.99.26.66:49655 [11/Aug/2020:11:26:45.595] srv_java all_java_srv/srv_1 1/0/50755 5 cD 1/1/0/0/0 0/0


global
        log /dev/log    local0
        log /dev/log    local1 notice
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd 
listeners
        stats timeout 30s
        user haproxy
        group haproxy
        daemon

        # Default SSL material locations
        ca-base /etc/ssl/certs
        crt-base /etc/ssl/private

        # Default ciphers to use on SSL-enabled listening sockets.
        # For more information, see ciphers(1SSL). This list is from:
        #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
        # An alternative list with additional directives can be obtained from
        #  
https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
        ssl-default-bind-ciphers 
ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
        ssl-default-bind-options no-sslv3

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        timeout connect 5000
        timeout client  50000
        timeout server  50000
        errorfile 400 /etc/haproxy/errors/400.http
        errorfile 403 /etc/haproxy/errors/403.http
        errorfile 408 /etc/haproxy/errors/408.http
        errorfile 500 /etc/haproxy/errors/500.http
        errorfile 502 /etc/haproxy/errors/502.http
        errorfile 503 /etc/haproxy/errors/503.http
        errorfile 504 /etc/haproxy/errors/504.http

frontend srv_java
        bind 192.168.0.19:26000
        mode tcp
        default_backend all_java_srv

backend all_java_srv
        balance roundrobin
        mode tcp
        server srv_1 192.168.0.19:26001

Reply via email to