• Kafka安装部署


    #!/bin/bash
    kafka_ver=kafka_2.11-2.2.1
    kafka_tgz=$kafka_ver.tgz
    hostip=`hostname -i`
    broker_id=`echo $hostip | awk -F . '{print $4}'`
    cd /home/service/app
    wget http://10.12.29.98:8090/tools/kafka/$kafka_tgz
    tar zxf $kafka_tgz
    mv $kafka_ver kafka
    cd kafka/bin
    mv kafka-server-start.sh kafka-server-start.sh.bak
    wget http://10.12.29.98:8090/tools/kafka/kafka-server-start.sh
    cd ../config
    mv log4j.properties log4j.properties.bak
    #mv server.properties server.properties.bak
    wget http://10.12.29.98:8090/tools/kafka/log4j.properties
    #wget http://10.12.29.98:8090/tools/kafka/server.properties

    cat <<EOF > server.properties
    broker.id=$broker_id
    listeners=PLAINTEXT://$hostip:9092
    port=9092
    host.name=$hostip
    socket.receive.buffer.bytes=102400
    socket.request.max.bytes=104857600
    log.dirs=/home/service/var/kafka
    num.partitions=6
    auto.create.topics.enable=false

    default.replication.factor=2
    offsets.topic.replication.factor=3
    log.retention.hours=24
    log.retention.bytes=1073741824
    log.segment.bytes=1073741824
    log.retention.check.interval.ms=100000
    zookeeper.connect=10.15.72.29:2181,10.15.78.234:2181,10.15.66.217:2181/kafka_log
    zookeeper.connection.timeout.ms=6000
    group.initial.rebalance.delay.ms=3000
    log.cleaner.enable=true
    delete.topic.enable=true
    EOF

    wget http://10.12.29.98:8090/tools/kafka/start.sh -O /home/service/app/kafka/start.sh

    echo "*/2 * * * *  root /bin/bash  /home/service/app/kafka/start.sh" >> /etc/crontab

    mkdir -p /home/service/var/kafka
    chown -R service.service /home/service/var/kafka
    chown -R service.service /home/service/app/kafka
    su - service -c 'sh /home/service/app/kafka/bin/kafka-server-start.sh -daemon /home/service/app/kafka/config/server.properties'

  • 相关阅读:
    Python字符串学习
    文本压缩版本三
    文件压缩版本二
    文件压缩(2)
    d17包,logging模块,hashlib模块 openpyxl模块,深浅拷贝
    d16 collections模块 时间模块 random模块 os模块 sys模块 序列化模块 subprocess模块
    d15 常用模块之正则模块
    14天 模块 , 导模块 , 循环导入, 相对,绝对导入, 项目目录规范,
    13t天 迭代器,生成器,内置函数
    55 jquery
  • 原文地址:https://www.cnblogs.com/lwhctv/p/11257124.html
Copyright © 2020-2023  润新知