zoukankan      html  css  js  c++  java
  • kafka安装设置相关

    kafka

    #!/bin/bash
    basepath=$(cd `dirname $0`; pwd)
    #echo $basepath     #当前文件所在路径
    cd $basepath
    
    #修改zookeeper和server配置
    # vi ./config/zookeeper.properties  修改日志路径为dataDir=/home/logs/zookeeper
    # vi ./config/server.properties 修改日志路径为log.dirs=/home/logs/kafka-logs
    
    
    #启动zookeeoer和kafka-server
    nohup ./bin/zookeeper-server-start.sh ./config/zookeeper.properties & 
    nohup bin/kafka-server-start.sh config/server.properties &
    
    #查看服务是否启动成功
    #lsof -i:2181     (zookeeper端口)
    #lsof -i:9092      (kafka-server端口)
    
    #创建topic(topic名称: face)
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic face
    
    #删除topic (topic名称: face)
    #bin/kafka-topics.sh  --delete --zookeeper localhost:2181  --topic face
    
    
    #查看topic列表:
    #bin/kafka-topics.sh -zookeeper localhost:2181 --list
    
    #查看topic详情:
    #bin/kafka-topics.sh --zookeeper localhost:2181 --describe 
    
    #向创建的topic生产消息
    #bin/kafka-console-producer.sh --broker-list localhost:9092 --topic face
    
    #订阅topic 消费消息
    #bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic face --from-beginning
    #bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic face
    
    #创建9个topic,每个topic分区设为16
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Log_Heartbeat
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Face_Img
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Comp_Result
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Comp_Request_Real
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Feature_Extraction_Result
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Setting_Change
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Device_Manager
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Comp_Request_Offline
    #bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 16 --topic Topic_Face_Register
  • 相关阅读:
    程序员职业规划
    SSH框架优缺点
    Servlet的生命周期,并说出Servlet和CGI的区别,Servlet与JSP的区别
    什么是J2EE,包括哪些规范!
    JS中定义类的方法
    audio.js – 随时随地,播放 HTML5 的声音
    jquery面试题里 缓存问题如何解决?
    产生一个int数组,长度为100,并向其中随机插入1-100,并且不能重复
    JAVA排序算法
    java面试题中常见的关于String类问题总结
  • 原文地址:https://www.cnblogs.com/mathyk/p/14009346.html
Copyright © 2011-2022 走看看