kafka伪分布式安装
kafka作为分布式消息系统在企业中有广泛的应用。本篇主要介绍kafka的伪分布式安装,资料来源:http://kafka.apache.org/documentation.html。1.kafka依赖zookeeper,zookeeper的安装和启动暂时不在这里介绍。如果有需要,请大家查询相关资料。
2.首先下载kafka软件,下载地址为:https://www.apache.org/dyn/closer.cgi?path=/kafka/0.8.2.1/kafka_2.10-0.8.2.1.tgz
2.将下载的文件解压,放到目录/home/grid/下
3.配置/home/grid/kafka_2.10-0.8.2.1/config/server.properties文件,将日志文件目录修改为
# A comma seperated list of directories under which to store log files
log.dirs=/opt/kafka-logs
4.每个broker代表一个kafka server端,每个broker对应一个server.properties的配置文件,我们搭建运行3个broker的伪分布式环境。配置文件分别为config/server.properties、config/server1.properties、config/server2.properties。
config/server-1.properties:
broker.id=1
port=9093
log.dir=/opt/kafka-logs-1
config/server-2.properties:
broker.id=2
port=9094
log.dir=/opt/kafka-logs-2
5.启动broker。
bin/kafka-server-start.sh config/server.properties &
bin/kafka-server-start.sh config/server-1.properties &
bin/kafka-server-start.sh config/server-2.properties &
页:
[1]