日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

linux kafka离线安装,centos 离线安装confluent_kafka 模块

發(fā)布時(shí)間:2023/12/10 linux 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux kafka离线安装,centos 离线安装confluent_kafka 模块 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

centos 離線安裝confluent_kafka 模塊

背景:需要安裝Python模塊的機(jī)子不能上網(wǎng),只能下載源碼進(jìn)行安裝

說(shuō)明:如果可以上網(wǎng)直接pip install confluent_kafka 即可

需安裝模塊:

confluent_kafka #confluent_kafka 依賴librdkafka 模塊:

librdkafka

安裝包下載:

https://pypi.org/project/confluent-kafka/

https://github.com/edenhill/librdkafka

安裝:

先安裝librdkafka 模塊:

cd librdkafka

./configure --prefix=/usr

make

make install

ldconfig

再安裝confluent_kafka 模塊:

cd confluent_kafka

python setup.py install

測(cè)試:

import confluent_kafka

如果出現(xiàn)錯(cuò)誤:

from .cimpl import (Consumer, # noqa

ImportError: librdkafka.so.1: cannot open shared object file: No such file or directory

解決辦法:

ldconfig

如果出現(xiàn)錯(cuò)誤:

confluent_kafka/src/confluent_kafka.h:21:32: fatal error: librdkafka/rdkafka.h: No such file or directory

#include

^

compilation terminated.

error: command 'gcc' failed with exit status 1

解決辦法:

./configure --prefix=/usr #增加前綴

make

make -j

make install

ldconfig

#如果仍報(bào)錯(cuò),在本機(jī)搜索librdkafka/rdkafka.h是否存在,如果已經(jīng)存在,那么退出或者新建一個(gè)終端重新嘗試即可

如果出現(xiàn)錯(cuò)誤:

In file included from confluent_kafka/src/confluent_kafka.c:17:0:

confluent_kafka/src/confluent_kafka.h:17:20: fatal error: Python.h: No such file or directory

#include

^

compilation terminated.

error: command 'gcc' failed with exit status 1

解決辦法:

yum install python-dev

參考鏈接:

https://blog.csdn.net/qq_35887983/article/details/79308723

https://github.com/confluentinc/confluent-kafka-python/issues/184

https://github.com/confluentinc/confluent-kafka-python/issues/65

總結(jié)

以上是生活随笔為你收集整理的linux kafka离线安装,centos 离线安装confluent_kafka 模块的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。