kafka安装步骤
Posted studynt
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kafka安装步骤相关的知识,希望对你有一定的参考价值。
kafka 安装内存会报不够
https://stackoverflow.com/questions/9350437/incompatible-initial-and-maximum-heap-sizes-specified
Picked up _JAVA_OPTIONS: -Xmx1024M
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000000b5a00000, 1073741824, 0) failed; error=‘Cannot allocate memory‘ (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 1073741824 bytes for committing reserved memory.
需要调整jvm
export _JAVA_OPTIONS=-Xmx1024M
export _JAVA_OPTIONS=-Xms512M
bin/kafka-server-start.sh config/server.properties
Picked up _JAVA_OPTIONS: -Xms512M
创建topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic a2
Created topic "a2".
查看topic
bin/kafka-topics.sh --list --zookeeper localhost:2181
发送消息到指定的topic
bin
/kafka-console-producer
.sh --broker-list localhost:9092 --topic
test
WARN [Producer clientId=console-producer] Error while fetching metadata with correlation id 1 : {test=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient)
如果发现是没有leader的提示错误,需要修改配置文件
!-- p.p1>!-- p.p1>!-- p.p1>!-- p.p1>!-- p.p1>!-- p.p1>!-- p.p1>
以上是关于kafka安装步骤的主要内容,如果未能解决你的问题,请参考以下文章