kafka端口号修改

本文详细介绍了Kafka的配置步骤,包括Zookeeper的clientPort设置为2182,服务器端口改为9093,并连接Zookeeper。对于单机环境,配置了standalone连接,集群环境则配置了distributed连接。此外,还展示了消费者和生产者的配置,如bootstrap.servers设为localhost:9093,以及Zookeeper.connect设为localhost:2182。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • 内置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

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lizz666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值