安装
https://www-eu.apache.org/dist/kafka/2.3.0/kafka_2.11-2.3.0.tgz
tar -zxvf kafka_2.11-2.3.0.tgz
mv kafka_2.11-2.3.0 /usr/local/kafka
vim /usr/local/kafka/config/server.properties
broker.id=1
log.dir=/data/kafka/logs
配置zookeeper 使用kafka/bin/下自带的zk
bin/zookeeper-server-start.sh -daemon config/zookeeper.properties
kafka-zk 需要依赖java环境
apt-get install openjdk-8-jdk
运行 报错 卒。配置项和环境比较多 不搞了
bin/kafka-server-start.sh config/server.properties
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000c0000000, 1073741824, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1073741824 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /usr/local/kafka/hs_err_pid25796.log
重新开始
使用docker安装
sudo docker pull wurstmeister/kafka
有疑问加站长微信联系(非本文作者)