0

在集群模式下提交 python 作业时遇到以下错误:

appcache/application_1548793257188​​_803870/container_e80_1548793257188​​_803870_01_000001/environment/lib/python2.7/site-packages/confluent_kafka/ init .py”,第 2 行,从 .cimpl 导入(消费者,# noqa ImportError: librdkafka.so.1:文件:没有这样的文件或目录

librdkafka 和其他 python 依赖项仅安装在边缘节点上。在提交之前,我创建了一个虚拟环境并通过以下方式 pip install confluent-kafka :

pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org --no-binary :all: confluent-kafka

之后,我创建 environment.tar.gz 并使用 --archives 将其传递给 spark-submit

我试图设置这样的火花属性:

--conf spark.executorEnv.LD_LIBRARY_PATH=/usr/lib64:environment/lib/python2.7/site-packages/confluent_kafka/.libs"
--conf spark.driver.extraLibraryPath=/usr/lib64:environment/lib/python2.7/site-packages/confluent_kafka/.libs"
--conf spark.yarn.appMasterEnv.LD_LIBRARY_PATH=environment/lib/python2.7/site-packages/confluent_kafka/.libs"

但不幸的是它没有工作!

有人遇到同样的问题吗?

4

0 回答 0