zoukankan      html  css  js  c++  java
  • kafka集群部署

    1.安装好zookeeper集群

    2.下载kafaka安装包,上传到服务器并解压

    wget https://archive.apache.org/dist/kafka/0.8.2.2/kafka_2.11-0.8.2.2.tgz
    scp kafka_2.11-0.8.2.2.tgz mini1:/root/apps/
    tar -zxvf /kafka_2.11-0.8.2.2.tgz -C install
    mv /kafka_2.11-0.8.2.2 kafka
    

    3.配置环境变量

    vim /etc/profile
    export KAFKA_HOME=/root/apps/install/kafka
    export PATH=$PATH:$KAFKA_HOME/bin
    

    4.修改配置文件

    改三处,分别是broker_id,log_dirs,host.name以及zookeeper地址

    vim /root/apps/install/kafka/config/server.properties
    
    
    ############################# Server Basics #############################
    #每台机器的brocker.id要不同
    broker.id=0
    
    ############################# Socket Server Settings #############################
    
    port=9092
    
    #host.name=localhost
    
    num.network.threads=2
    
    num.io.threads=2
    
    socket.send.buffer.bytes=1048576
    
    socket.receive.buffer.bytes=1048576
    
    socket.request.max.bytes=104857600
    
    
    ############################# Log Basics #############################
    
    #自定义一个日志目录
    log.dirs=/root/apps/install/kafka/kafka-logs
    
    num.partitions=2
    
    ############################# Log Flush Policy #############################
    log.flush.interval.messages=10000
    
    log.flush.interval.ms=1000
    
    ############################# Log Retention Policy #############################
    
    log.retention.hours=168
    
    #log.retention.bytes=1073741824
    
    log.segment.bytes=536870912
    
    log.cleanup.interval.mins=1
    
    ############################# Zookeeper #############################
    #zookeeper集群地址
    zookeeper.connect=mini1:2181,mini2:2181,mini3:2181
    
    zookeeper.connection.timeout.ms=1000000
    
    host.name=localhost
    

    5.分发

    scp -r kafka mini2:/root/apps/install/
    scp -r kafka mini3:/root/apps/install/ 
    scp -r kafka mini4:/root/apps/install/
    
    scp /etc/profile mini2:/etc/
    source /etc/profile
    scp /etc/profile mini3:/etc/
    source /etc/profile
    scp /etc/profile mini4:/etc/
    source /etc/profile
    

    6.启动与关闭

    #启动
    kafka-server-start.sh /root/apps/install/kafka/config/server.properties &
    
    #关闭
    pkill -9 -f server.properties
  • 相关阅读:
    重拾安卓_01_安卓开发环境搭建(eclipse)
    重拾安卓_01_安卓开发环境搭建(android studio)
    【BZOJ】1038: [ZJOI2008]瞭望塔
    【BZOJ】2178: 圆的面积并
    【UR #4】元旦三侠的游戏(博弈论+记忆化)
    【BZOJ】1027: [JSOI2007]合金(凸包+floyd)
    【POJ】1151 Atlantis(线段树)
    【POJ】1228 Grandpa's Estate(凸包)
    【POJ】1556 The Doors(计算几何基础+spfa)
    【POJ】1113 Wall(凸包)
  • 原文地址:https://www.cnblogs.com/52mm/p/p22.html
Copyright © 2011-2022 走看看