x机器上通过yum安装librdkafka1时出现libsasl

x机器上通过yum安装librdkafka1时出现libsasl

本文介绍了在AWS Linux机器上通过yum安装librdkafka1时出现libsasl依赖问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用pip安装python confluent-kafka软件包.我正在运行Amazon Linux(版本Amazon Linux AMI版本2016.09)的aws ec2实例上尝试此操作.我只是在做:

I'm trying to install the python confluent-kafka package using pip. I'm attempting this on an aws ec2 instance that is running amazon linux (version Amazon Linux AMI release 2016.09). I'm simply doing:

pip install pip install confluent-kafka

这会产生以下错误:

In file included from confluent_kafka/src/confluent_kafka.c:17:0:
confluent_kafka/src/confluent_kafka.h:21:32: fatal error: librdkafka/rdkafka.h: No such file or directory
 #include <librdkafka/rdkafka.h>
                                ^
compilation terminated.
error: command 'gcc' failed with exit status 1

为解决此问题,我做了两件事:

To resolve this, I did two things:

1)按照此页面上的说明进行操作,并添加文件/etc/yum.repos.d/confluent.repo,内容如下:

1) Followed the instructions on this page and added the file /etc/yum.repos.d/confluent.repo with the contents:

[Confluent.dist]
name=Confluent repository (dist)
baseurl=http://packages.confluent.io/rpm/3.0/6
gpgcheck=1
gpgkey=http://packages.confluent.io/rpm/3.0/archive.key
enabled=1

[Confluent]
name=Confluent repository
baseurl=http://packages.confluent.io/rpm/3.0
gpgcheck=1
gpgkey=http://packages.confluent.io/rpm/3.0/archive.key
enabled=1

2)尝试使用以下命令安装librdkafka库:

2) attempted to install the librdkafka library using this command:

sudo yum clean all
sudo yum install -y librdkafka1 librdkafka-devel

但是,Yum吐出了这个错误:

Yum spits out this error however:

Error: Package: librdkafka1-0.9.1_confluent3.0.1-1.el7.x86_64 (Confluent.dist)
       Requires: openssl-libs
Error: Package: librdkafka1-0.9.1_confluent3.0.1-1.el7.x86_64 (Confluent.dist)
       Requires: libsasl2.so.3()(64bit)

一些谷歌搜索之后,我尝试了以下操作:

After some googling, I tried:

sudo ln /usr/lib64/libsasl2.so.2 /usr/lib64/libsasl2.so.3

这没有效果.我尝试进行yum升级,但这也没有解决问题.经过大量的搜索,此kafka用户组帖子是唯一的我可以找到非常有用的东西,但可悲的是它没有包含解决问题的方法.

This had no effect. I tried doing a yum upgrade and this also did not solve the issue. After much googling, this kafka user group post is the only remotely helpful thing I can find, but it sadly does not contain a solution to the problem.

我真的很想在这个实例上启动并运行kafka python,所以任何建议将不胜感激.

I'd really like to get kafka python up and running on this instance, so any suggestions would be greatly appreciated.

推荐答案

Amazon Linux 2016.19似乎基于RHEL 6,因此您需要参考 Confluent docs ,即将以下内容写入/etc/yum.repos.d/confluent :

Amazon Linux 2016.19 seems to be based on RHEL 6 so you will need to reference Confluent's RHEL 6 Yum repo as described in Confluent docs, namely by writing the following to /etc/yum.repos.d/confluent:

[Confluent.dist]
name=Confluent repository (dist)
baseurl=http://packages.confluent.io/rpm/3.1/6
gpgcheck=1
gpgkey=http://packages.confluent.io/rpm/3.1/archive.key
enabled=1

[Confluent]
name=Confluent repository
baseurl=http://packages.confluent.io/rpm/3.1
gpgcheck=1
gpgkey=http://packages.confluent.io/rpm/3.1/archive.key
enabled=1

其次:

$ sudo yum clean all
$ sudo yum install gcc librdkafka1 librdkafka-devel cyrus-sasl-devel openssl-libs python-devel
$ pip install confluent-kafka  (possibly in a virtualenv)

这篇关于在AWS Linux机器上通过yum安装librdkafka1时出现libsasl依赖问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 17:11