码迷,mamicode.com
首页 > 其他好文 > 详细

kafka安装步骤

时间:2018-07-06 11:32:49      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:open   flow   start   The   lead   environ   ica   actor   com   

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的提示错误,需要修改配置文件

 

 

 

kafka安装步骤

标签:open   flow   start   The   lead   environ   ica   actor   com   

原文地址:https://www.cnblogs.com/studyNT/p/9272314.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!