下载地址:
wget http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/0.10.0.1/kafka_2.11-0.10.0.1.tgz
- 注意事项:
1、 下载mirrors版本好一点,下载源码版本,在启动kafka的时候,会爆一下错误信息
Error: Could not find or load main class kafka.Kafka
2、启动kafka的时候,如发现,有节点启动不起来,并出现如下错误信息
Java HotSpot(TM) Server VM warning: INFO: os::commit_memory(0x67e00000, 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...
则说明kafka启动时,jvm所需内存配置超过了系统内存,因为Kafka默认使用-Xmx1G -Xms1G的JVM内存配置,如果机器内存较小,需要调整启动配置,按如下调整
vim bin/kafka-server-start.sh;
修改KAFKA_HEAP_OPTS的值,如下
因为本人系统内存分配的大小刚好是1G,所以每次只能启动一个kafka 节点,修改申请大小就好了