• kafka集群搭建


    一、zookeeper集群搭建

      略,请参考其他文档,这里不再赘述。

    二、下载kafka

      从kafka官网下载kafka_2.11-0.11.0.0.tgz,并解压。

    tar -zxvf kafka_2.11-0.11.0.0

    三、kafka配置修改

      这里我们仅以两台kafka实例做集群。

      打开kafka属性文件

    vim ${kafka_home}/config/server.properties

      修改其中的关键属性

    # The id of the broker. This must be set to a unique integer for each broker.
    broker.id=0
    
    # 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 znodes.
    zookeeper.connect=192.168.2.233:2181,192.168.2.234:2181,192.168.2.235:2181
    
    # 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

      broker.id 第一台机器写0,第二台机器写1,以此类推。

      zookeeper.connect :将zookeeper集群的地址和端口写上。

      num.partitions=1 :每个topic的partition默认数量。可根据自己项目的情况进行配置。

      其他属性请参照官网。

    四、kafka集群启动  

    nohup ${kafka_home}/bin/kafka-server-start.sh ${kafka_home}/config/server.properties &

      将两台机器的kafka启动,集群搭建完毕。

      集群搭建就是这么简单。

  • 相关阅读:
    Adb 命令
    python 属性
    python 计时器
    【网易云课堂工作】什么是本能三元组
    functiontools.partial
    源码
    听总结
    线程和死锁
    加入kendall进入计算
    添加K-CORE值进入运算
  • 原文地址:https://www.cnblogs.com/boboooo/p/7798929.html
Copyright © 2020-2023  润新知