安装librdkafka
git clone https://github.com/edenhill/librdkafka.git
cd librdkafka
./configure --prefix /usr
make
sudo make install
下载源码
go get -u github.com/confluentinc/confluent-kafka-go/kafka
以上都githup给出的,需要执行以下命令,否则会异常
sudo ldconfig
/tmp/go-build616273194/b001/exe/consumer: error while loading shared libraries: librdkafka.so.1: cannot open shared object file: No such file or directory
来源:oschina
链接:https://my.oschina.net/u/3247419/blog/2050756