kafka集群

1、kafka单点安装,参考另一篇
2、这里介绍kafka集群的配置
配置文件介绍
这里写图片描述

  • zookeeper集群安装
    #/usr/local/kafka/config
    #vim zookeeper.properties
    这里写图片描述
    # 创建myid文件
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
maxClientCnxns=100

tickTime=2000
initLimit=10
syncLimit=5

server.1=10.1.11.9:2888:3888
server.2=10.1.11.10:2888:3888

# cd /tmp/zookeeper
这里写图片描述
创建myid文件,并以次写入1,2,3

  • kafka集群配置
    # /usr/local/kafka/config
    # vim server.properties
    设置broker.id、host.name、zookeeper.connect
  • 测试运行
    生产者:
./bin/kafka-console-consumer.sh --bootstrap-server 10.1.11.9:9092,10.1.11.10:9092 --topic luyangTest --from-beginning

消费者:

./bin/kafka-console-consumer.sh --bootstrap-server 10.1.11.9:9092,10.1.11.10:9092 --topic luyangTest --from-beginning

常见问题:

  • 问题如下
    这里写图片描述
    解决思路:改异常可无需管理,主要是集群环境下,当前服务器请求另一台服务时,另一台服务器未启动,导致的问题。等所有的机器都运行起来就不会报了。

  • 一定要关闭防火墙,这一点很重要

参考资料

http://blog.csdn.net/gongxinju/article/details/53415051
http://blog.csdn.net/zxy987872674/article/details/72466504

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值