Giter Site home page Giter Site logo

Comments (7)

jchanam avatar jchanam commented on May 29, 2024

In order to add you info, what we get through logs is the following:

[WARNING] 214/091626 (1) : Server redis/redis_01 is DOWN, reason: Layer7 timeout, info: " at step 4 of tcp-check (expect string 'role:master')", check duration: 1001ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[WARNING] 214/091626 (1) : Server redis/redis_02 is DOWN, reason: Layer7 timeout, info: " at step 4 of tcp-check (expect string 'role:master')", check duration: 1001ms. 1 active and 0 backup servers left. 1 sessions active, 0 requeued, 0 remaining in queue.

ps. The redis_03 is the actual master.

Thanks!

from haproxy.

ebuildy avatar ebuildy commented on May 29, 2024

Can you explain a bit more your infrastructure? Such as number of Docker hosts, private/public networks ....

from haproxy.

jchanam avatar jchanam commented on May 29, 2024

All the dockers are running inside the same VM's. Docker is only used on the VM_X (drawn below). The PHP-FPM connects to the HAProxy in order to connect to the redis master.

We've got:

VM_X
+---------------------------------------------+    VM_Y[1|2|3]
| +---------+    +-----------+    +---------+ |    +---------------+
| | Varnish | -> | Nginx+PHP | -> | HAProxy | | -> | Redis Cluster |
| +---------+    +-----------+    +---------+ |    +---------------+
+---------------------------------------------+

What we've found out, is that the dockers maintain the connections open, and, because of there are "different" machines, does not find out the HAProxy has been restarted.

Is there any option to make the dockers restart on cascade?
Is there any way to make the dockers know that other one has been restarted?

Thanks!

from haproxy.

yosifkit avatar yosifkit commented on May 29, 2024

So the HAProxy container is restarted, getting a new IP, and the PHP container has a --link my-haproxy:custom-haproxy to it? Currently there is not a simple way to cascade restarts, but, as long as it is the same container (ie just a docker stop and start), the PHP container would get an updated entry in /etc/hosts with the new IP. So now the PHP container can hit custom-haproxy or whatever the link name is.

I am not sure I am even debugging in the right area, but maybe this helps 😕.

from haproxy.

jchanam avatar jchanam commented on May 29, 2024

Hi!

Yes, I've got the containers linked as you've said.

What I'm trying to do is a script that, via docker api, checks the updated time and, based on setted dependencies, restart the dockers.

I don't know if there's an easier way of doing this.

Apart from this, what is strange, is that when the haproxy is restarted, he php can get to redis, but other than the master node. I haven't been able to found out why by now...

Thank you for all your efforts!

from haproxy.

freiit avatar freiit commented on May 29, 2024

with docker >=1.9 there is an easier way. Put all containers with 'docker network ...' in a local network, too, so they can find each other always with their names. If you replace a container, just give it the same name and you don't need to replace cascading containers.

from haproxy.

tianon avatar tianon commented on May 29, 2024

I agree -- I think the new Docker Networks feature should help mitigate this particular issue. Regardless, this appears to be an issue specific to Docker's routing, not something inherent to the image. If that's not the case, I think a new issue with more details explaining what the image is doing wrong and hopefully clues for how we can fix it would be appreciated! 👍

from haproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.