zoukankan      html  css  js  c++  java
  • kafka集群搭建

    1.下载kafka包(时间点:2016-09-06,版本:kafka_2.11-0.10.0.1)

    wegt http://mirrors.hust.edu.cn/apache/kafka/0.10.0.1/kafka_2.11-0.10.0.1.tgz

    2.解压

    tar -zxvf kafka_2.11-0.10.0.1.tgz

    3.修改bin/kafka-server-start.sh

    将对堆内存修改为:-Xmx6G -Xms6G(官方推荐配置)
    export JMX_PORT="19092"(jconsole或者jvisualvm能够远程连接查看内存等)

    4.修改日志配置

    把每项的DatePattern修改为'.'yyyy-MM-dd(只需每天rolling就可以了)

    5.修改config/server.properties配置

     broker.id=0(每个节点不能一样)
     # listeners = security_protocol://host_name:port
     listeners=PLAINTEXT://xxx:9092
     # advertised.listeners=PLAINTEXT://arreat00:9092
     # Replication configurations
     num.replica.fetchers=2
     default.replication.factor=3
     controller.socket.timeout.ms=30000
     # Log configuration
     num.partitions=3
     message.max.bytes=1000000
     auto.create.topics.enable=true
     log.flush.interval.ms=10000
     log.flush.interval.messages=20000
     log.flush.scheduler.interval.ms=2000
     log.dirs=/home/xxx/xxx/kafka/log

     # ZK configuration
     zookeeper.connect=ip:port,ip:port,ip:port/xx/xxx
     zookeeper.connection.timeout.ms=6000
     zookeeper.sync.time.ms=2000

     # Socket server configuration
     num.io.threads=8
     num.network.threads=3
     socket.request.max.bytes=104857600
     socket.receive.buffer.bytes=1048576
     socket.send.buffer.bytes=1048576
     queued.max.requests=16

    每项的具体解释可见:http://blog.csdn.net/louisliaoxh/article/details/51516084
    该配置修改的是官方推荐的生产环境的配置:http://kafka.apache.org/documentation.html#config


    6.启动:bin/kafka-server-start.sh -daemon config/server.propertie



    参考博客:https://blog.csdn.net/JThink_/article/details/52708853

  • 相关阅读:
    js 变量命名规范
    JS
    python 处理中文十六进制的encode %E9%99%88%E8%80%81%E5%B8%88/%E5%9B%BE%E7%89%87
    Pycharm 项目上传至Gitee/Github详细步骤
    Python 类型建议符, Python 定义函数的时候有冒号:
    Python 解析 JSON
    Python 解析 JSON
    Mac 安装 WordPress
    java常用书籍下载
    Docker环境搭建Redis4.0 Cluster
  • 原文地址:https://www.cnblogs.com/cyf18/p/14289193.html
Copyright © 2011-2022 走看看