-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker integration #13
Comments
Thanks for submitting an issue. I looked over your script and don't see anything wrong with the java command you're running to start Rapid nodes. Can you double check if the seed node is brought up before the others (the seed node has listenAddress == seedAddress)? |
I checked again and the seed node is launch immediately, while the other nodes wait 60 seconds to be launched. |
It shouldn't be an issue, I've ran it on overlay networks before. To make sure it's not the overlay network, can you try to bring up the nodes outside of docker on a single machine? |
Running 3 nodes, in a single machine, as described in the README file results in every node being stuck. Every node prints the following:
|
Yes, it can't find a log4j configuration file, and therefore does not print any information. Here's an example log4j.configuration file you can use: https://gist.github.com/lalithsuresh/5abe5990e94c5e999550a107d67aa062 Then do:
|
Thank you. I can run the 3 nodes example in a single machine. However, I cannot do it using Docker. |
Have you verified the firewall settings on the overlay network? What about MTU sizes? I'm guessing here because the logs don't have enough info for me to go on. |
@francisco-polaco thinking further about your issue, I wonder if your overlay network is remapping ports (is there NAT involved)? |
@lalithsuresh I checked the network configuration and I don't believe its anything related with NAT. Could you check if this log represents the correct functioning of Rapid? Because I see a lot of exceptions and the cluster size went from 1 to 8. |
It's reporting the right cluster size, but I suspect the default messaging layer we use (gRPC) is experiencing issues, judging from the errors you see. I'll dig deeper and get back to you. |
Hey @lalithsuresh! Any progress regarding this issue? |
My suspicion is that the default timeouts are too low, which causes some gRPC messages to timeout (during the join phase, because they take the longest). This then causes a bunch of late responses to show up at nodes, which gives the unknown stream errors. I usually set messaging timeouts on my own when running Rapid experiments. Can you please try the version here: https://github.com/lalithsuresh/rapid/tree/issue-13? |
As before, a lot of exceptions related to deadlines were thrown, but in between exceptions some nodes were added to the membership. I've bootstrapped 10, but the cluster size is 8. |
Yeah, a join timing out after 20 seconds is definitely pathological -- something is definitely wrong with gRPC's messaging between nodes here. Any instructions on how I can reproduce your docker setup? |
I set up something using the Dockerfile you'd shared earlier and I can reproduce the behavior you're seeing. I'll investigate and keep you posted! |
I take that back. I'm still not able to reproduce it. :) Can you share your docker workflow here so I can try it out too? This is what I tried and it works for me:
Every terminal reports something like:
|
The network driver I am using is Overlay, creating a "closed" cluster. |
@francisco-polaco : can you share the commands you used to create the network and deploy the swarm? |
In this case, the swarm only have one node, since I'm trying to run it on my local machine. Swarm creation: Network creation: Service launching: Then use |
Still seems to work for me when I create a swarm according to your instructions: https://gist.github.com/lalithsuresh/40f57f402c14e9716ac0bfbe04810069 Note that some of the cancellations reported by gRPC are benign (for example, during the join phase, the joiner makes progress as soon as it hears from even one of its temporary observers -- the remaining responses get dropped). If you however see a lot of messages with DEADLINE_EXCEEDED, that's bad. |
If it helps:
|
I am running the same docker version as you and this time I've run the commands by hand. |
You are building the right jar, judging from the timeouts being printed. It seems like even the most simple RPCs (like the first join request message) are timing out in your trace, whereas it isn't the case on mine. I find this odd, given that the timeouts are high. That would explain not just the DEADLINE_EXCEEDED messages, but also the "Received DATA frame for an unknown stream " errors in your STDERR (because the caller receives a response after the timeout). Let's try increasing the timeouts one more time. Can you pull the latest version from the issue-13 branch? I've bumped up some of the timeouts to 5 seconds. By the way, please note that the StandaloneAgent code terminates after 400 seconds -- which causes docker swarm to keep recreating the containers. |
Again, the same behavior https://gist.github.com/francisco-polaco/64137ef4cf07a8074dc81ce31353eb6f |
Your compilation is fine. The previous command you'd shared with me was not using the overlay network. I'll retry again with the new commands you'd shared and get back to you. One question: how are you forcing swarm to create a container with the first node's IP? |
I just delete and create the network again. The IPs are reset. So in the container-start-script.sh you replace the variable FIRST_NODE_IP by something like 172.28.0.10 and that node will be the seed node. If you replace by that IP, I think it should work like a charm :) |
Thanks! I'm able to reproduce the effect now. I tried two runs: It works fine with this:
But not when I use the flag you had to limit CPU utilization:
Can you double check? |
Note, the command you ran likely limits the CPU utilization per container to 10% of a single core. |
Yup the culprit was the CPU limit. In my python script, I also was limiting the CPU. |
Perfect. I'll close the issue now. Thanks for your patience! |
@francisco-polaco : Thanks to what you found, I ended up profiling Rapid to see why limiting CPU resources caused it to react that badly. One culprit was the excessive hash computations in MembershipView which I've cut down almost entirely with some caching. Rerunning Rapid in a docker container with --limit-cpus 0.10 still throws some gRPC exceptions (with the higher timeouts on the issue-13 branch though), but the cluster does reach the right size of 10 every time. I've cherry picked that commit to the master branch. |
Hashes can be quite heavy when computed multiple times. I also had the same problem with a software I was implementing. |
@francisco-polaco Yes, I still see them too. My patch doesn't fully eliminate that issue. The bigger problem is that there are multiple threads, mainly from gRPC (which is based on Netty, which polls continuously to check for messages to send/receive). Not good if there are limited CPU resources. :) |
Hi all,
I was trying to launch some Rapid nodes using Docker, but every node is throwing an exception saying that it cannot join.
Basically, I've compiled using maven and Java 8 and copied the JAR files to a Docker image. From what I could inspect, the JARs have all the dependencies needed.
I've attached a zip file with my Docker file, the container's script and a log of a previous attempt.
files.zip
Do you have any idea of what is causing this issue?
Thank you
The text was updated successfully, but these errors were encountered: