KAFKA配置
程序员文章站
2022-06-14 10:45:54
...
1、安装环境准备
1)系统:centos 6.5 64位,Ext4
2)安装包列表:
Kafka:192.168.137.11/卷皮网/软件包目录/kafka/kafka_2.11-0.9.0.0.tar.gz
zookeeper:软件件包和安装请看zk安装手册。
3)机器要求
基本配置:
32GB of memory / 7200 rpm SATA drives
推荐配置: 64GB of memory / SAS
2、软件安装步骤(需要提供软件启动脚本)
安装目录:/usr/data/xxx
启动脚本:nohup ./bin/kafka-server-start.sh config/server.properties &
3、配置文件说明(关键配置需要给出说明)
配置文件在 config/server.properties 注:broker.id 和 host.name 每个节点都不一样
# The id of the broker. This must be set to a unique integer for each broker.
# 群集中节点的唯一标识,一般0为开始,新一个节点加1(如broker.id=1,broker.id=2 )
broker.id=0
############################# Socket Server Settings #############################
# 一般配置成本地IP
listeners=PLAINTEXT://192.168.143.4:9092
# Hostname the broker will bind to. If not set, the server will bind to all interfaces
# 默认会从/etc/hosts取,一般配置成本地IP
host.name=192.168.143.4
############################# Log Basics #############################
# A comma seperated list of directories under which to store log files
# kakfa数据储存目录,这是应用日志目录,是数据目录
log.dirs=/data/kafka-logs
# The default number of log partitions per topic. More partitions allow greater
# parallelism for consumption, but this will also result in more files across
# the brokers.
# 分区数据,测试和压测环境等可以配置3,线上需要做容量规划。
num.partitions=3
# Zookeeper connection string (see zookeeper docs for details).
# This is a comma separated host:port pairs, each corresponding to a zk
# server. e.g. "127.0.0.1:3000,127.0.0.1:3001,127.0.0.1:3002".
# You can also append an optional chroot string to the urls to specify the
# root directory for all kafka zones.
# zk集群ip
zookeeper.connect=192.168.143.2:2181,192.168.143.3:2181,192.168.144.2:2181
4、检验方法(检验是否按照成功) 在kafka目录执行:
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 3 --topic test
替换命令的zk地址