Kafka的安装和部署及测试

时间:2021-12-22 17:40:36

1、简介

  大数据分析处理平台包括数据的接入,数据的存储,数据的处理,以及后面的展示或者应用。今天我们连说一下数据的接入,数据的接入目前比较普遍的是采用kafka将前面的数据通过消息的方式,以数据流的形式将数据接入到大数据存储平台。

  下面主要介绍一下kafka的安装和部署的过程。由于公司采用的是cloudera公司的产品,所以直接通过cloudera manager来安装部署kafka。只不过在安装的过程中,注意几个问题即可:

(1)存放kafka的log文件的位置

默认是/var/log/kafka/

(2)存放kafka的data的位置

默认是/var/local/kafka/data

这些路径需要手动创建,并注意他们的权限的问题。

2、kafka组建简介,并用控制台的方式来模拟一下

(1)kafka主要有:producer、broker、topic、consumer。在安装好kafka之后,首先需要创建一个topic,实际上这个topic就是对应的将消息进行分类,也可以理解成message queue。创建topic的命令是:

  kafka-topics --create --zookeeper hadoop3:2181 --replication-factor 1 --partitions 1 --topic hello

在这里hadoop3表示的是部署zookeeper的主机名(由于我部署的zookeeper只有一台机器,所以对应的就是hadoop3,这个根据具体的情况会不同),hello是对应的topic名称,--replication-factor参数指定对应的消息的副本数

(2)创建好了topic之后,接下来就是生产者往这个topic中进行生产:

   kafka-console-producer --broker-list hadoop2:9092 --topic hello

在这里hadoop2表示的是部署broker的主机名,hello对应的就是topic名称。

(3)第三步就是消费对应的消息了:

   kafka-console-consumer --zookeeper hadoop3:2181 --topic hello --from-beginning

在这里hadoop3表示的是对应部署zookeeper的主机名,hello表示的就是topic的名称。

(4)查看topic的一些信息:

  创建多副本的topic:kafka-topics --create --zookeeper hadoop3:2181 --replication-factor 3 --partitions 1 --topic multi

   查看多副本的分布情况:kafka-topics --describe --zookeeper hadoop3:2181  --topic multi

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA88AAAAsCAIAAADU0R0lAAANYklEQVR4nO2d247dthWG+Tx6kKSFgAJxMvB4pkjr+qgEbZO0afoCehA9x7xC06BA644zGU8Qw8nEM3FRBDV8uOnF3triYXGRIsVNSvq/u70lkYtci0u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IIRAfgYAFMjXz18d3F/7O0kAAAAAAABIwqPLlzfurP192wAAAAAAAKTg/yfTF3GnvD22AAAAAElFTkSuQmCC" alt="" width="931" height="42" />

(5)测试一下容错机制

测试一下容错能力Broker 1作为leader运行,现在我们直接重启102的那台主机 ,后我们查看topic的信息可以看到另外一个节点被选做了leader,102 不再出现在 Isr 列表中:  

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0IAAABTCAIAAAA9XiCAAAAUgUlEQVR4nO2dy+7lRhHG/TyWUAghySOw8IIFIoQNEgskzOUx/CB+BZQrJ5cnYMECiWSYQUJigQSZzBuwOL50dVdVX213n/P9VjN/293VXdXl73Tb7u5Pf/lX/5NfdXUzTLfbNFxtBQAAAABATXz813//YPj11VYAAAAAAIBIPvvbf97+6W+utgIAAAAAAERy+/t/3/nZb6+2AgAAAAAARPLli+/e++B3V1sBAAAAAAAi+erl9+9/+IerrQAAAAAAAJF8/erN+7/849VWAAAAAACASL7+Zxsyrh/n2515vNoWABbG+TaP/dVWPALoSQCAy+NlhvIt+oqTcbtmquNrbf04b6aY35Bb7Cwk7NbCTo2YcS7cy8O0yV2hIf04z2PXdeMc0dYiXb3HlWFgWSeeTLsp5pJoV3B7conkOlLQOTQ9Flyazs97roq333Ntr2X9/Vr2BPXah6SyHLvdYNOtKt+iL1+9eY+TcWd33KotOOjXf/txNqNYuzDNihMbPky3eZ4PGJRaQ4bpNo9dN0yx9WZ2teW4giXrlT7KTbE4FwzzWOKDtHkeLGJbzM/9OBs36WGKUnL304VrFw0wjyMf2OYNfpjozd537WU8WMSGIYbiJb3x5as371Yu4+xDNLW3mCYWhul2m0ZZ3GTgkXHTcIGMW+TjASUrPGWKCQQyrkYeLGIbzs8btqDynEsjls/vbGDrdzrfny/jwSI2jLpk3Bev3rz7YZiMW2cTp2FfHqOn7fON3LSvdNT8O3fCHrXbmY6Mk2Y62WU8wah57J2Gp7RoWwwyK2fH7G0etTmqDPwyLiHajEvM/l4OKf1MjzLnJJes4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r0nns7eNyyTGRE+kFrslWEZqPSORcPTh9WP1P/ip83cP2b2p+zsrealy5DuQnks6NDba97mSduKyRWq9Tt1PBcfVaJ5wzHLiOljKKZZMnqzy5jEunnmUlAAAAJsjPBcl8bK65epsDMi4RpAkAAKgT5OdyMM8ZPnS97QEZlwCZHK1hgQkAAEDXdcjP4NmAjAMAAAAAaBLIOAAAAACAJoGMAwAAAABoEsg4AAAAAIAmgYwDAAAAAGgSyDgAAAAAgCYpLOOUzy6b3ynmXgLP+kZ8Rr1G7fhGDQAAAADaoZiM27YQGfnvLpobt9l7itEtRe+fbj6jXrOQeT5/bzUAAAAAgHTKL6ryn892d7BWNBO3YfCB9Q7T7TaNF2yRCwAAAACQDiPjMjbPXi535VBvyyd1r5RyMi6g3mW6roeMAwAAAEBTnCTjnD8qMi5RUCXWu0pGyDgAAAAAtMVJi6phMm55FSFtF7ykevfNdyHjAAAAANAWVcm4O+ZLCcfWe6+p3/4NGQcAAACAdvjk21NkXD/OVJmpz8YlPRyXUO+yfGwCJQcAAACARvjk2++ueFNVV3GMjFu+/abM0mXWi9k4AAAAALTFx66MO+IVh67rhmkr0fp+Wz/ON2up0ylinH0mxddLgIwDAAAAQFsUk3H7Vgk7VhHaPg1kfdORU8omDZn1WidAyQEAAACgFRgZVyH3jR3SZgcBAAAAAB6Sj7797q2f1y7j9s+CAAAAAACAOx9904CMAwAAAAAANh998z/IOAAAAACA5vg/Ooh7DC0XENsAAAAASUVORK5CYII=" alt="" />

虽然最初负责续写消息的leader down掉了,但之前的消息还是可以消费的:

> bin/kafka-console-consumer.sh --zookeeper hadoop3:2181 --from-beginning --topic mutil
...
my test message 1
my test message 2