zoukankan      html  css  js  c++  java
  • 消息队列集群kafka安装配置

    1. 下载
    wget http://mirror.rise.ph/apache/kafka/0.11.0.0/kafka_2.12-0.11.0.0.tgz
    2. 安装
    tar xf kafka_2.12-0.11.0.0.tgz
    mv kafka_2.12-0.11.0.0 /data/elk/kafka
    3. 配置文件
        3.1 zookeeper集群:cat config/zookeeper.propertie
            dataDir=/data/zookeeper
            maxClientCnxns=0
            tickTime=2000
            initLimit=20
            syncLimit=10
            server.1=59.188.25.2xx:2888:3888   
            #server.2=59.188.25.2xx:2888:3888
            #server.3=59.188.25.2xx:2888:3888
        #配置zookeeperid
         mkdir /data/zookeeper
         echo "1" >/data/zookeeper/myid    
            
        3.2 kafka:cat config/server.properties
            broker.id=1
            host.name=59.188.25.225
          log.dirs=/data/logs/kafka-logs
          zookeeper.connect=59.188.25.2xx:2181     #如果有多台逗号隔开写多台,59.188.25.2xx:2181,59.188.25.2xx:2181,59.188.25.2xx:2181
          num.partitions=16
          log.retention.hours=168
          
          ####复制配置文件到其它集群节点,注意下面几点不同
          zoookeeper:  
              echo "x" >/data/zookeeper/myid    # x就是broker.id的数字
          kafka:
              broker.id = x
              hostname=59.188.25.2xx:2181   
    4. 启动和关闭
        zookeeper
            启动:nohup /data/elk/kafka/bin/zookeeper-server-start.sh /data/elk/kafka/config/zookeeper.properties &
            关闭:/data/elk/kafka/bin/zookeeper-server-stop.sh
        kafka
            启动:nohup /data/elk/kafka/bin/kafka-server-start.sh /data/elk/kafka/config/server.properties &
            关闭:/data/elk/kafka/bin/kafka-server-stop.sh
    5. 数据查询
        /data/elk/kafka/bin/kafka-console-consumer.sh --zookeeper 127.0.0.1:2181 --topic web-zx-proxy-nginx-log --from-beginning

  • 相关阅读:
    autoresizing代码实现
    控制器的view的加载优先级
    iOS控制器的创建方式
    关于深复制和浅复制
    关于textField
    h5页面列表滚动加载数据
    数据库中存储过程和函数的区别
    Docker搭建Portainer可视化界面
    Docker部署springboot,从简单Eureka开始
    docker安装rabbitmq
  • 原文地址:https://www.cnblogs.com/zhaojonjon/p/7290866.html
Copyright © 2011-2022 走看看