• 13(flume安装)


    1,安装flume

    node0002

    cd /software     上传apache-flume-1.6.0-bin.tar.gz

    tar xf apache-flume-1.6.0-bin.tar.gz -C /opt/sxt/

    cd /opt/sxt/apache-flume-1.6.0-bin/conf

    mv flume-env.sh.template flume-env.sh

    echo $JAVA_HOME     获取环境变量

    vi flume-env.sh     (修改里面的JAVA_HOME)

    2,flume连接kafka配置

    vi fk.conf      (conf文件夹下创建文件)

    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1
    
    # Describe/configure the source
    a1.sources.r1.type = avro
    a1.sources.r1.bind = node0002
    a1.sources.r1.port = 41414
    
    # Describe the sink
    a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
    a1.sinks.k1.topic = testflume
    a1.sinks.k1.brokerList = node0002:9092,node0003:9092,node0004:9092
    a1.sinks.k1.requiredAcks = 1
    a1.sinks.k1.batchSize = 20
    
    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000000
    a1.channels.c1.transactionCapacity = 10000
    
    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1

    3,启动kafka

    zkServer.sh start      三台机器

    cd /opt/sxt/k*   三台机器

    ./bin/kafka-server-start.sh ./config/server.properties    (三台机器都启动)

    node0002重开窗口:

    cd /opt/sxt/apache-flume-1.6.0-bin/bin

    bin/flume-ng agent -n a1 -c conf -f conf/fk.conf -Dflume.root.logger=DEBUG,console

  • 相关阅读:
    squid反向代理
    LVM逻辑卷管理
    磁盘分区
    磁盘阵列
    apache基本配置
    LNMP简要配置
    高性能Web服务器Nginx
    samba文件共享服务配置(multiuser机制)二 (共两节)
    samba文件共享服务配置一(共2节)
    linux 批量修改文件名 文件名只保留部分,去掉部分
  • 原文地址:https://www.cnblogs.com/dongchao3312/p/13603927.html
Copyright © 2020-2023  润新知