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
  • 相关阅读:
    Redis 服务端程序实现原理
    Redis 中的客户端
    Redis 中的数据持久化策略(AOF)
    Redis 中的数据持久化策略(RDB)
    Redis 中的数据库
    Redis 的底层数据结构(对象)
    Redis 的底层数据结构(压缩列表)
    Redis 的底层数据结构(整数集合)
    又离职了~
    如何救活被屏蔽的主机,继续开发工作
  • 原文地址:https://www.cnblogs.com/mathyk/p/14009346.html
Copyright © 2011-2022 走看看