sFlowTrend running on multiple docker containers

42 views
Skip to first unread message

Giovanni Pipitò

unread,
Jan 24, 2022, 10:23:46 AM1/24/22
to sFlowTrend
Hi,

I need to run 2 sFlowTrend instances on 2 different docker containers on the same host.
I ran the docker run commands as it follows:

  • container 1

    docker run -v /dockerdata/sflowtrend-pro:/var/local/sflowtrend-pro -p 6343:6343/udp -p 8087:8087 -p 8443:8443 -h sflowtrend-pro -e TZ=Europe/Rome -d --restart unless-stopped sflow/sflowtrend-edge

  • container 2

    docker run -v /dockerdata/sflowtrend-wan:/var/local/sflowtrend-pro -p 6344:6343/udp -p 8088:8087 -p 8444:8443 -h sflowtrend-wan -e TZ=Europe/Rome -d --restart unless-stopped sflow/sflowtrend-wan

Both container start and are reachable on 8443/8444 but whenever I interact with one of them, the other one says "sFlowTrend client lost the connection to the server".
Am I doing something wrong?

Kind Regards

Giovanni Pipitò

unread,
Jan 24, 2022, 10:37:04 AM1/24/22
to sFlowTrend
sorry...the correct commands are:

    • container 1

      docker run -v /dockerdata/sflowtrend-pro:/var/local/sflowtrend-pro -p 6343:6343/udp -p 8087:8087 -p 8443:8443 -h sflowtrend-pro -e TZ=Europe/Rome -d --restart unless-stopped sflow/sflowtrend

    • container 2

      docker run -v /dockerdata/sflowtrend-wan:/var/local/sflowtrend-pro -p 6344:6343/udp -p 8088:8087 -p 8444:8443 -h sflowtrend-wan -e TZ=Europe/Rome -d --restart unless-stopped sflow/sflowtrend

    sgjohnston

    unread,
    Jan 25, 2022, 4:44:21 AM1/25/22
    to sFlowTrend
    Hi Giovanni,

    The problem with this is that browsers do not distinguish between different ports when sending cookies, so the same cookies are sent to your two instances of sFlowTrend. This does not work, as the session is used as a key part of the connection to sFlowTrend, and the sessions are completely separate between the two instances - but they will receive the same session cookie.

    There are a few ways to work around this:

    1. Use a different browser (or different client systems) to access each sFlowTrend instance. This is simple, but obviously not very convenient.

    2. Create two DNS name aliases for the same system, either in /etc/hosts on the client, or as CNAMEs in DNS. So you would have sflowtrend1 and sflowtrend2, both pointing to the same IP address. You would then access sFlowTrend via these aliases. I think this will work OK (although it would need to be tested). 

    3. Use a different docker network than the default bridge, namely macvlan. This allows each docker container to have its own IP address, which will mean they are completely separate systems, as far as a browser is concerned.

    regards,
    Stuart

    Giovanni Pipitò

    unread,
    Jan 25, 2022, 5:43:10 AM1/25/22
    to sFlowTrend
    Hi Stuart,

    I suspected something was wrong with javascript. Thanks a lot for your reply.

    Kind Regards

    Reply all
    Reply to author
    Forward
    0 new messages