-
Notifications
You must be signed in to change notification settings - Fork 218
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
Can't import pykafka.rdkafka #280
Comments
I'm not super familiar with how dependencies get packaged for storm, but I think this might require adding the rdkafka binary and pykafka's c extension binary to the JAR that storm is running. @dan-blanchard will probably be able to verify. |
Just to clarify, do you have it installed on your worker nodes?
You probably need
This shouldn't require that, because we don't actually package the virtualenv in the JAR. They just get created on the workers. |
@dan-blanchard: I have it on my workers. If I manually use the virtualenv created by streamparse, I can use rdkafka. Setting |
Hmm... looks like we need to get even fancier with our option parsing. Probably should just support YAML for those. That said, when I address #276, you won't have to pass them in as command-line options anyway. |
@dan-blanchard: Can you think of any way for me to bypass this in the short term? |
Without modifying your copy of streamparse, no. You could probably just add YAML parsing here and things would work as expected. I say YAML and not JSON, because JSON requires quotes around string literals, whereas the quotes are optional for YAML, so that would work for all the options we get passed in with |
@tdhopper Actually, you can just set the For example: class FancyKafkaTopology(Topology):
some_spout = SomeSpout.spec(config={'LD_LIBRARY_PATH': '/path/to/librdkafka'}})
some_bolt = SomeBolt.spec(inputs=[some_spout],
config={'LD_LIBRARY_PATH': '/path/to/librdkafka'}}) |
@dan-blanchard @emmett9001 unfortunately setting |
Actually, it looks like I can import it on one of my supervisors but not the other. 🙄 No idea why. |
Part of the issue is that I had tried installing Once I removed that, I built rdkafka using these instructions. Once I do that, |
Running |
I faced this problem recently. I was getting the below error:
My setup when I was facing the problem was: (The order below is important for this to work, what I believed and ideally it should work, for me it did not)
Note: Even using LD_LIBRARY_PATH with correct path for librdkafka lib it did not work. Solution
If all steps above are followed well, |
I'm trying to use librdkafka with Streamparse. I have librdkafka installed with pykafka on my supervisor machines. I can run the Python binary in my topology virtualenv and successfully call
from pykafka import rdkafka
. However, when I try to import it from my spout initialization routine, I get:Any idea how to resolve this? Maybe something with setting my path.
Pinging @emmett9001 too.
The text was updated successfully, but these errors were encountered: