1、下载kafka 安装包
wget http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
tar -xvzf kafka_2.12-2.3.0.tgz
2、下载安装librdkafka
git clone https://github.com/edenhill/librdkafka
cd librdkafka/
./configure
make && make install
3、kafka使用说明
http://kafka.apache.org/22/documentation.html
4、编译安装
配置kafka动态库地址
sudo vim /etc/ld.so.conf
添加 /usr/local/lib/
sudo ldconfig
编译选项
-I/usr/local/include/librdkafka/ -L/usr/local/include/ -lrdkafka -lrdkafka++
先启动zookeeper服务和kafka服务,在启动生产者,消费者
c++ kafka测试例子