zoukankan      html  css  js  c++  java
  • Flume集群搭建

    0. 软件版本下载
    http://mirror.bit.edu.cn/apache/flume/
     
    1. 集群环境
    Master 172.16.11.97
    Slave1 172.16.11.98
    Slave2 172.16.11.99
     
    2. 下载软件包
    #Master
    wget http://mirror.bit.edu.cn/apache/flume/1.6.0/apache-flume-1.6.0-bin.tar.gz
    tar zxvf apache-flume-1.6.0-bin.tar.gz
     
     
    ---到此,其实就结束了,没错,下载下来就能用,剩余的就是看数据采集方式的配置了
     
    3. 修改Flume配置
    #NetCat
    vim conf/flume-netcat.conf
    # Name the components on this agent
    agent.sources = r1
    agent.sinks = k1
    agent.channels = c1
     
    # Describe/configuration the source
    agent.sources.r1.type = netcat
    agent.sources.r1.bind = 127.0.0.1
    agent.sources.r1.port = 44444
     
    # Describe the sink
    agent.sinks.k1.type = logger
     
    # Use a channel which buffers events in memory
    agent.channels.c1.type = memory
    agent.channels.c1.capacity = 1000
    agent.channels.c1.transactionCapacity = 100
     
    # Bind the source and sink to the channel
    agent.sources.r1.channels = c1
    agent.sinks.k1.channel = c1
     
    #验证
    #Server
    bin/flume-ng agent --conf conf --conf-file conf/flume-netcat.conf --name=agent -Dflume.root.logger=INFO,console
    #Client
    telnet master 44444
     
    #Exec
    vim conf/flume-exec.conf
    # Name the components on this agent
    agent.sources = r1
    agent.sinks = k1
    agent.channels = c1
     
    # Describe/configuration the source
    agent.sources.r1.type = exec
    agent.sources.r1.command = tail -f /data/hadoop/flume/test.txt
     
    # Describe the sink
    agent.sinks.k1.type = logger
     
    # Use a channel which buffers events in memory
    agent.channels.c1.type = memory
    agent.channels.c1.capacity = 1000
    agent.channels.c1.transactionCapacity = 100
     
    # Bind the source and sink to the channel
    agent.sources.r1.channels = c1
    agent.sinks.k1.channel = c1
    #Server
    bin/flume-ng agent --conf conf --conf-file conf/flume-exec.conf --name=agent -Dflume.root.logger=INFO,console
    #Client
    while true;do echo `date` >> /data/hadoop/flume/test.txt ; sleep 1; done
     
     
    #Avro
    vim conf/flume-avro.conf
    # Define a memory channel called c1 on agent
    agent.channels.c1.type = memory
     
    # Define an avro source alled r1 on agent and tell it
    agent.sources.r1.channels = c1
    agent.sources.r1.type = avro
    agent.sources.r1.bind = 127.0.0.1
    agent.sources.r1.port = 44444
     
    # Describe/configuration the source
    agent.sinks.k1.type = hdfs
    agent.sinks.k1.channel = c1
    agent.sinks.k1.hdfs.path = hdfs://master:9000/flume_data_pool
    agent.sinks.k1.hdfs.filePrefix = events-
    agent.sinks.k1.hdfs.fileType = DataStream
    agent.sinks.k1.hdfs.writeFormat = Text
    agent.sinks.k1.hdfs.rollSize = 0
    agent.sinks.k1.hdfs.rollCount= 600000
    agent.sinks.k1.hdfs.rollInterval = 600
     
    agent.channels = c1
    agent.sources = r1
    agent.sinks = k1
    #验证
    #Server
    bin/flume-ng agent --conf conf --conf-file conf/flume-netcat.conf --name=agent -Dflume.root.logger=DEBUG,console

  • 相关阅读:
    sql 行列转换之关键字pivot,unpivot
    构建动态表达式(初级)
    HttpApplication事件执行顺序
    【转】delegate.BeginInvoke 注意事项
    Jquery.extend函数详解【转】
    【转】NET中反射实现 可空类型 与基础类型的转换 以及获取指定属性的大小问题
    sql执行字符串
    Javascript获取浏览器地址栏url各项值
    你妹的浏览器DNS缓存
    LazyLoad 延迟加载图片的jQuery插件介绍
  • 原文地址:https://www.cnblogs.com/students/p/9482284.html
Copyright © 2011-2022 走看看