kafka 安装及配置

1.下载安装包并解压

kafka_2.11-2.1.0.tgz

2. 配置kafka集群

cd /usr/local/kafka_2.11-2.1.0/config

############################# Server Basics #############################

# The id of the broker. This must be set to a unique integer for each broker.
broker.id=0      # 这个标识是kafka这台服务器

############################# Socket Server Settings #############################

# The address the socket server listens on. It will get the value returned from 
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
#listeners=PLAINTEXT://:9092  # kafka 监听地址端口

############################# Log Basics #############################

# A comma separated list of directories under which to store log files
log.dirs=/tmp/kafka-logs  # 日志存储目录 & 保存kafka数据(维护消息持久化)

# 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.
num.partitions=1      #存储kafka每条消息的分区数量


猜你喜欢

转载自blog.51cto.com/11726705/2443257