- 内置zookeeper配置
$ vim config/zookeeper.properties
# the port at which the clients will connect
clientPort=2182
- 修改server端口号,默认port没有写在文件中
$ vim config/server.properties
# 服务端口号,默认9092
port=9093
# 对应zk地址
zookeeper.connect=localhost:2182
- 单机环境配置
$ vim config/connect-standalone.properties
# These are defaults. This file just demonstrates how to override some settings.
bootstrap.servers=localhost:9093
- 集群环境配置
$ vim config/connect-distributed.properties
# These are defaults. This file just demonstrates how to override some settings.
bootstrap.servers=localhost:9093
本地客户端配置,不用可以不修改。
- 消费端配置
$ vim config/consumer.properties
# Zookeeper connection string
# 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"
zookeeper.connect=127.0.0.1:2182
- 发布端配置修改
$ vim config/producer.properties
# list of brokers used for bootstrapping knowledge about the rest of the cluster
# format: host1:port1,host2:port2 ...
bootstrap.servers=localhost:9093