本文主要是介绍kraft单机安装kafka无需安装zookeeper(Kafka2.8版本之后支持),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
kraft单机安装kafka无需安装zookeeper(Kafka2.8版本之后支持)
下载
官网地址: http://kafka.apache.org/downloads.html
这里选择的是kafka_2.12-3.6.0.tgz
创建kafka相关目录
mkdir -p /usr/local/kafka/kafka_2.12-3.6.0
上传安装包并解压
tar -zxvf kafka_2.12-3.6.0.tgz -C /usr/local/kafka/ -C /usr/local/kafka/
生成uuid
sh /usr/local/kafka/kafka_2.12-3.6.0/bin/kafka-storage.sh random-uuid
[root@localhost bin]# sh /usr/local/kafka/kafka_2.12-3.6.0/bin/kafka-storage.sh random-uuid
C4mOgAy4TouDNwkz_35D0A
[root@localhost bin]#
格式化存储目录
sh /usr/local/kafka/kafka_2.12-3.6.0/bin/kafka-storage.sh format -t C4mOgAy4TouDNwkz_35D0A -c /usr/local/kafka/kafka_2.12-3.6.0/config/kraft/server.properties
[root@localhost kraft]# sh /usr/local/kafka/kafka_2.12-3.6.0/bin/kafka-storage.sh format -t C4mOgAy4TouDNwkz_35D0A -c /usr/local/kafka/kafka_2.12-3.6.0/config/kraft/server.properties
Formatting /tmp/kraft-combined-logs with metadata.version 3.6-IV2.
[root@localhost kraft]#
后台启动kafka
sh /usr/local/kafka/kafka_2.12-3.6.0/bin/kafka-server-start.sh -daemon /usr/local/kafka/kafka_2.12-3.6.0/config/kraft/server.properties &
查看启动日志
tail -f /usr/local/kafka/kafka_2.12-3.6.0/logs/server.log
停止kafka
sh /usr/local/kafka/kafka_2.12-3.6.0/bin/kafka-server-stop.sh
这篇关于kraft单机安装kafka无需安装zookeeper(Kafka2.8版本之后支持)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!