安装错误:

librdkafka error

#错误
rdkafka_topic.c:321:59: error: 'Z_DEFAULT_COMPRESSION' dndeclared (fitrst use in this function)

#原因:
缺少zlib-devel库,编译不通过。
查询zlib相关安装包可以看到zlib-devel没有安装
[root@localhost ~]# rpm -qa|grep zlib
zlib-1.2.7-17.el7.x86_64

#解决方法:
yum install zlib-devel -y
运行错误:

librdkafka error

#错误
./infocenter: error while loading shared libraries: librdkafka.so.1: 
cannot open shared object file: No such file or directory

#原因:
64位系统,在/usr/lib64路径没有找到库
[root@localhost infocenter]# ll /usr/lib64/librdkafka*

然后在/usr/lib下找到
[root@localhost infocenter]# ll /usr/lib/librdkafka*
-rwxr-xr-x. 1 root root 14194266 Jul  2 17:50 /usr/lib/librdkafka.a
-rwxr-xr-x. 1 root root  2492808 Jul  2 17:50 /usr/lib/librdkafka++.a
lrwxrwxrwx. 1 root root       15 Jul  2 17:50 /usr/lib/librdkafka.so -> librdkafka.so.1
lrwxrwxrwx. 1 root root       17 Jul  2 17:50 /usr/lib/librdkafka++.so -> librdkafka++.so.1
-rwxr-xr-x. 1 root root  5750088 Jul  2 17:50 /usr/lib/librdkafka.so.1
-rwxr-xr-x. 1 root root   963968 Jul  2 17:50 /usr/lib/librdkafka++.so.1

#解决方法:
cp /usr/lib/librdkafka* /usr/lib64/
Logo

Kafka开源项目指南提供详尽教程,助开发者掌握其架构、配置和使用,实现高效数据流管理和实时处理。它高性能、可扩展,适合日志收集和实时数据处理,通过持久化保障数据安全,是企业大数据生态系统的核心。

更多推荐