kafka启动命令

启动

    ./bin/kafka-server-start.sh –daemon config/server.properties

    //创建主题
    $>kafka-topics.sh --zookeeper s202:2181 --topic calllog --create --replication-factor 3 --partitions 4


    //查看主题列表
    $>kafka-topics.sh --zookeeper s202:2181 --list

    //启动控制台消费者,消费calllog主题,用于测试.
    $>kafka-console-consumer.sh --zookeeper s201:2181 --topic calllog

    //启动控制台消费者,消费calllog主题,用于测试.
    $>kafka-console-consumer.sh --zookeeper s201:2181 --topic calllog

//配置flume

  1. a1.sources = r1  

  2. a1.sinks = k1  

  3. a1.channels = c1  

  4. # Describe/configure the source  

  5. a1.sources.r1.type = exec  

  6. a1.sources.r1.command = tail -F /home/airib/work/log.log  

  7. # Describe the sink  

  8. #a1.sinks.k1.type = logger  

  9. a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink  

  10. a1.sinks.k1.topic = test  

  11. a1.sinks.k1.brokerList = localhost:9092  

  12. a1.sinks.k1.requiredAcks = 1  

  13. a1.sinks.k1.batchSize = 20  

  14. # Use a channel which buffers events in memory  

  15. a1.channels.c1.type = memory  

  16. a1.channels.c1.capacity = 1000  

  17. a1.channels.c1.transactionCapacity = 100 

  18. # Bind the source and sink to the channel  

  19. a1.sources.r1.channels = c1  

  20. a1.sinks.k1.channel = c

//flume读数据到kafka(flume的启动命令)

   bin/flume-ng agent -c conf -f conf/dir-exec.conf -n a1

//启动Hadoop,从kafka读取数据存放到hbase中

//启动hbase

start-hbase.sh

//

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值