Flume篇---Flume安装配置与相关使用

Hadoop之flume 框架日志采集原理及使用 文章目录FLUME 框架一 概述1.1 Flume定义1.2Flume的优点1.3Flume组成架构1)Agent2)Source3)Channel4)Sink5)Event1.4Flume拓扑结构1.5 Flume &Agent内部原理二 快速入门2.1 Flume安装地址1) Flume官网地址2)文档查看地址3)下载地址2.2 安装部署三 企业开发案例3.1监控端口数据官方案例1)案例需求:2)需求分析:3)实现步骤:1.安装netcat工具2.判断44444端口是否被占用基本语法:nets 阅读详情

一.前述

Copy过来一段介绍Apache Flume 是一个从可以收集例如日志,事件等数据资源,并将这些数量庞大的数据从各项数据资源中集中起来存储的工具/服务,或者数集中机制。flume具有高可用,分布式,配置工具,其设计的原理也是基于将数据流,如日志数据从各种网站服务器上汇集起来存储到HDFS,HBase等集中存储器中。官网:http://flume.apache.org/FlumeUserGuide.html

二.架构

1.基本架构

介绍:

Source:(相当于一个来源)

   从数据发生器接收数据,并将接收的数据以Flume的event格式传递给一个或者多个通道channal,Flume提供多种数据接收的方式,比如Avro,Thrift,twitter1%等

Channel:(相当于一个中转)

 channal是一种短暂的存储容器,它将从source处接收到的event格式的数据缓存起来,直到它们被sinks消费掉,它在source和sink间起着一共桥梁的作用,channal是一个完整的事务,这一点保证了数据在收发的时候的一致性. 并且它可以和任意数量的source和sink链接. 支持的类型有: JDBC channel , File System channel , Memort channel等.

sink:(相当于最后的写出)

  sink将数据存储到集中存储器比如Hbase和HDFS,它从channals消费数据(events)并将其传递给目标地. 目标地可能是另一个sink,也可能HDFS,HBase.

2.延伸架构

  2.1利用AVRO中转

2.2一般多个来源时可以配置这样

ps:

Avro([ævrə])是Hadoop的一个子项目,由Hadoop的创始人Doug Cutting(也是Lucene,Nutch等项目的创始人) 牵头开发 。Avro是一个数据序列化系统,设计用于支持大批量数据交换的应用。它的主要特点有:支持二进制序列化方式,可以便捷,快速地处理大量数据;动态语言友好,Avro提供的机制使动态语言可以方便地处理Avro数据。
三。具体实施
3.1 安装
1、上传
2、解压
3、修改conf/flume-env.sh  文件中的JDK目录
 注意:JAVA_OPTS 配置  如果我们传输文件过大 报内存溢出时 需要修改这个配置项
4、验证安装是否成功  ./flume-ng version
5、配置环境变量
    export FLUME_HOME=/home/apache-flume-1.6.0-bin


3.2 Source、Channel、Sink有哪些类型
    Flume Source
    Source类型                   | 说明
    Avro Source                 | 支持Avro协议(实际上是Avro RPC),内置支持
    Thrift Source               | 支持Thrift协议,内置支持
    Exec Source                 | 基于Unix的command在标准输出上生产数据
    JMS Source                   | 从JMS系统(消息、主题)中读取数据
    Spooling Directory Source | 监控指定目录内数据变更
    Twitter 1% firehose Source|    通过API持续下载Twitter数据,试验性质
    Netcat Source               | 监控某个端口,将流经端口的每一个文本行数据作为Event输入
    Sequence Generator Source | 序列生成器数据源,生产序列数据
    Syslog Sources               | 读取syslog数据,产生Event,支持UDP和TCP两种协议
    HTTP Source                 | 基于HTTP POST或GET方式的数据源,支持JSON、BLOB表示形式
    Legacy Sources               | 兼容老的Flume OG中Source(0.9.x版本)

    Flume Channel
    Channel类型       说明
    Memory Channel                | Event数据存储在内存中
    JDBC Channel                  | Event数据存储在持久化存储中,当前Flume Channel内置支持Derby
    File Channel                  | Event数据存储在磁盘文件中
    Spillable Memory Channel   | Event数据存储在内存中和磁盘上,当内存队列满了,会持久化到磁盘文件
    Pseudo Transaction Channel | 测试用途
    Custom Channel                | 自定义Channel实现

    Flume Sink
    Sink类型     说明
    HDFS Sink             | 数据写入HDFS
    Logger Sink           | 数据写入日志文件
    Avro Sink             | 数据被转换成Avro Event,然后发送到配置的RPC端口上
    Thrift Sink           | 数据被转换成Thrift Event,然后发送到配置的RPC端口上
    IRC Sink              | 数据在IRC上进行回放
    File Roll Sink         | 存储数据到本地文件系统
    Null Sink             | 丢弃到所有数据
    HBase Sink             | 数据写入HBase数据库
    Morphline Solr Sink | 数据发送到Solr搜索服务器(集群)
    ElasticSearch Sink     | 数据发送到Elastic Search搜索服务器(集群)
    Kite Dataset Sink     | 写数据到Kite Dataset,试验性质的
    Custom Sink           | 自定义Sink实现



案例1、 A simple example
    http://flume.apache.org/FlumeUserGuide.html#a-simple-example
    
    配置文件
    ############################################################
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = netcat
    a1.sources.r1.bind = localhost
    a1.sources.r1.port = 44444

    # Describe the sink
    a1.sinks.k1.type = logger

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################

启动flume
flume-ng agent -n a1 -c conf -f simple.conf -Dflume.root.logger=INFO,console 指定配置目录
flume-ng agent -n a1 -f op5 -Dflume.root.logger=INFO,console 不用指定配置目录,将上诉source,channel,sink的文件起名为a1,同时指定这个文件在哪

安装telnet
yum install telnet
退出 ctrl+]  quit

Memory Chanel 配置
  capacity:默认该通道中最大的可以存储的event数量是100,
  trasactionCapacity:每次最大可以source中拿到或者送到sink中的event数量也是100
  keep-alive:event添加到通道中或者移出的允许时间
  byte**:即event的字节量的限制,只包括eventbody



案例2、两个flume做集群(第一个agent的sink作为第二个agent的source)

    node01服务器中,配置文件
    ############################################################
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = netcat
    a1.sources.r1.bind = node1
    a1.sources.r1.port = 44444

    # Describe the sink
    # a1.sinks.k1.type = logger
    a1.sinks.k1.type = avro
    a1.sinks.k1.hostname = node2
    a1.sinks.k1.port = 60000

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    
    node02服务器中,安装Flume(步骤略)
    配置文件
    ############################################################
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = avro
    a1.sources.r1.bind = node2
    a1.sources.r1.port = 60000

    # Describe the sink
    a1.sinks.k1.type = logger

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    
    先启动node02的Flume
    flume-ng agent  -n a1 -c conf -f avro.conf -Dflume.root.logger=INFO,console
    
    再启动node01的Flume
    flume-ng agent  -n a1 -c conf -f simple.conf2 -Dflume.root.logger=INFO,console
    
    打开telnet 测试  node02控制台输出结果


案例3、Exec Source(监听一个文件)
        http://flume.apache.org/FlumeUserGuide.html#exec-source
        
    配置文件
    ############################################################
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = exec
    a1.sources.r1.command = tail -F /home/flume.exec.log

    # Describe the sink
    a1.sinks.k1.type = logger
    
    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    
    启动Flume
    flume-ng agent -n a1 -c conf -f exec.conf -Dflume.root.logger=INFO,console
    
    创建空文件演示 touch flume.exec.log
    循环添加数据
    for i in {1..50}; do echo "$i hi flume" >> flume.exec.log ; sleep 0.1; done
        
案例4、Spooling Directory Source(监听一个目录)

        http://flume.apache.org/FlumeUserGuide.html#spooling-directory-source
    配置文件
    ############################################################
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = spooldir
    a1.sources.r1.spoolDir = /home/logs

    a1.sources.r1.fileHeader = true

    # Describe the sink
    a1.sinks.k1.type = logger

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################

    启动Flume
    flume-ng agent -n a1 -c conf -f spool.conf -Dflume.root.logger=INFO,console

    拷贝文件演示
    mkdir logs
    cp flume.exec.log logs/


案例5、hdfs sink
        http://flume.apache.org/FlumeUserGuide.html#hdfs-sink
    
        配置文件
    ############################################################
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = spooldir
    a1.sources.r1.spoolDir = /home/logs
    a1.sources.r1.fileHeader = true

    # Describe the sink
    ***只修改上一个spool sink的配置代码块 a1.sinks.k1.type = logger
    a1.sinks.k1.type=hdfs
    a1.sinks.k1.hdfs.path=hdfs://sxt/flume/%Y-%m-%d/%H%M
    
    ##每隔60s或者文件大小超过10M的时候产生新文件
    # hdfs有多少条消息时新建文件,0不基于消息个数
    a1.sinks.k1.hdfs.rollCount=0
    # hdfs创建多长时间新建文件,0不基于时间
    a1.sinks.k1.hdfs.rollInterval=60
    # hdfs多大时新建文件,0不基于文件大小
    a1.sinks.k1.hdfs.rollSize=10240
    # 当目前被打开的临时文件在该参数指定的时间(秒)内,没有任何数据写入,则将该临时文件关闭并重命名成目标文件
    a1.sinks.k1.hdfs.idleTimeout=3
    
    a1.sinks.k1.hdfs.fileType=DataStream
    a1.sinks.k1.hdfs.useLocalTimeStamp=true
    
    ## 每五分钟生成一个目录:
    # 是否启用时间上的”舍弃”,这里的”舍弃”,类似于”四舍五入”,后面再介绍。如果启用,则会影响除了%t的其他所有时间表达式
    a1.sinks.k1.hdfs.round=true
    # 时间上进行“舍弃”的值;
    a1.sinks.k1.hdfs.roundValue=5
    # 时间上进行”舍弃”的单位,包含:second,minute,hour
    a1.sinks.k1.hdfs.roundUnit=minute

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1(将source,channel,sink关联)

    ############################################################
    创建HDFS目录
    hadoop fs -mkdir /flume
    
    启动Flume
    flume-ng agent -n a1 -c conf -f hdfs.conf -Dflume.root.logger=INFO,console

    查看hdfs文件
    hadoop fs -ls /flume/...
    hadoop fs -get /flume/...


http://flume.apache.org/

安装
1、上传
2、解压
3、修改conf/flume-env.sh  文件中的JDK目录
 注意:JAVA_OPTS 配置  如果我们传输文件过大 报内存溢出时 需要修改这个配置项
4、验证安装是否成功  ./flume-ng version
5、配置环境变量
    export FLUME_HOME=/home/apache-flume-1.6.0-bin


Source、Channel、Sink有哪些类型
    Flume Source
    Source类型                   | 说明
    Avro Source                 | 支持Avro协议(实际上是Avro RPC),内置支持
    Thrift Source               | 支持Thrift协议,内置支持
    Exec Source                 | 基于Unix的command在标准输出上生产数据
    JMS Source                   | 从JMS系统(消息、主题)中读取数据
    Spooling Directory Source | 监控指定目录内数据变更
    Twitter 1% firehose Source|    通过API持续下载Twitter数据,试验性质
    Netcat Source               | 监控某个端口,将流经端口的每一个文本行数据作为Event输入
    Sequence Generator Source | 序列生成器数据源,生产序列数据
    Syslog Sources               | 读取syslog数据,产生Event,支持UDP和TCP两种协议
    HTTP Source                 | 基于HTTP POST或GET方式的数据源,支持JSON、BLOB表示形式
    Legacy Sources               | 兼容老的Flume OG中Source(0.9.x版本)

    Flume Channel
    Channel类型       说明
    Memory Channel                | Event数据存储在内存中
    JDBC Channel                  | Event数据存储在持久化存储中,当前Flume Channel内置支持Derby
    File Channel                  | Event数据存储在磁盘文件中
    Spillable Memory Channel   | Event数据存储在内存中和磁盘上,当内存队列满了,会持久化到磁盘文件
    Pseudo Transaction Channel | 测试用途
    Custom Channel                | 自定义Channel实现

    Flume Sink
    Sink类型     说明
    HDFS Sink             | 数据写入HDFS
    Logger Sink           | 数据写入日志文件
    Avro Sink             | 数据被转换成Avro Event,然后发送到配置的RPC端口上
    Thrift Sink           | 数据被转换成Thrift Event,然后发送到配置的RPC端口上
    IRC Sink              | 数据在IRC上进行回放
    File Roll Sink         | 存储数据到本地文件系统
    Null Sink             | 丢弃到所有数据
    HBase Sink             | 数据写入HBase数据库
    Morphline Solr Sink | 数据发送到Solr搜索服务器(集群)
    ElasticSearch Sink     | 数据发送到Elastic Search搜索服务器(集群)
    Kite Dataset Sink     | 写数据到Kite Dataset,试验性质的
    Custom Sink           | 自定义Sink实现



案例1、 A simple example
    http://flume.apache.org/FlumeUserGuide.html#a-simple-example
    
    配置文件
    ############################################################
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = netcat
    a1.sources.r1.bind = localhost
    a1.sources.r1.port = 44444

    # Describe the sink
    a1.sinks.k1.type = logger

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################

启动flume
flume-ng agent -n a1 -c conf -f simple.conf -Dflume.root.logger=INFO,console

安装telnet
yum install telnet
退出 ctrl+]  quit

Memory Chanel 配置
  capacity:默认该通道中最大的可以存储的event数量是100,
  trasactionCapacity:每次最大可以source中拿到或者送到sink中的event数量也是100
  keep-alive:event添加到通道中或者移出的允许时间
  byte**:即event的字节量的限制,只包括eventbody



案例2、两个flume做集群

    node01服务器中,配置文件
    ############################################################
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = netcat
    a1.sources.r1.bind = node1
    a1.sources.r1.port = 44444

    # Describe the sink
    # a1.sinks.k1.type = logger
    a1.sinks.k1.type = avro
    a1.sinks.k1.hostname = node2
    a1.sinks.k1.port = 60000

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    
    node02服务器中,安装Flume(步骤略)
    配置文件
    ############################################################
    # Name the components on this agent
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = avro
    a1.sources.r1.bind = node2
    a1.sources.r1.port = 60000

    # Describe the sink
    a1.sinks.k1.type = logger

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    
    先启动node02的Flume
    flume-ng agent  -n a1 -c conf -f avro.conf -Dflume.root.logger=INFO,console
    
    再启动node01的Flume
    flume-ng agent  -n a1 -c conf -f simple.conf2 -Dflume.root.logger=INFO,console
    
    打开telnet 测试  node02控制台输出结果


案例3、Exec Source
        http://flume.apache.org/FlumeUserGuide.html#exec-source
        
    配置文件
    ############################################################
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = exec
    a1.sources.r1.command = tail -F /home/flume.exec.log

    # Describe the sink
    a1.sinks.k1.type = logger
    
    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    
    启动Flume
    flume-ng agent -n a1 -c conf -f exec.conf -Dflume.root.logger=INFO,console
    
    创建空文件演示 touch flume.exec.log
    循环添加数据
    for i in {1..50}; do echo "$i hi flume" >> flume.exec.log ; sleep 0.1; done
        
案例4、Spooling Directory Source
        http://flume.apache.org/FlumeUserGuide.html#spooling-directory-source
    配置文件
    ############################################################
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = spooldir
    a1.sources.r1.spoolDir = /home/logs
    a1.sources.r1.fileHeader = true

    # Describe the sink
    a1.sinks.k1.type = logger

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################

    启动Flume
    flume-ng agent -n a1 -c conf -f spool.conf -Dflume.root.logger=INFO,console

    拷贝文件演示
    mkdir logs
    cp flume.exec.log logs/


案例5、hdfs sink
        http://flume.apache.org/FlumeUserGuide.html#hdfs-sink
    
        配置文件
    ############################################################
    a1.sources = r1
    a1.sinks = k1
    a1.channels = c1

    # Describe/configure the source
    a1.sources.r1.type = spooldir
    a1.sources.r1.spoolDir = /home/logs
    a1.sources.r1.fileHeader = true

    # Describe the sink
    ***只修改上一个spool sink的配置代码块 a1.sinks.k1.type = logger
    a1.sinks.k1.type=hdfs
    a1.sinks.k1.hdfs.path=hdfs://sxt/flume/%Y-%m-%d/%H%M
    
    ##每隔60s或者文件大小超过10M的时候产生新文件
    # hdfs有多少条消息时新建文件,0不基于消息个数
    a1.sinks.k1.hdfs.rollCount=0
    # hdfs创建多长时间新建文件,0不基于时间
    a1.sinks.k1.hdfs.rollInterval=60
    # hdfs多大时新建文件,0不基于文件大小
    a1.sinks.k1.hdfs.rollSize=10240
    # 当目前被打开的临时文件在该参数指定的时间(秒)内,没有任何数据写入,则将该临时文件关闭并重命名成目标文件
    a1.sinks.k1.hdfs.idleTimeout=3
    
    a1.sinks.k1.hdfs.fileType=DataStream
    a1.sinks.k1.hdfs.useLocalTimeStamp=true
    
    ## 每五分钟生成一个目录:
    # 是否启用时间上的”舍弃”,这里的”舍弃”,类似于”四舍五入”,后面再介绍。如果启用,则会影响除了%t的其他所有时间表达式
    a1.sinks.k1.hdfs.round=true
    # 时间上进行“舍弃”的值;
    a1.sinks.k1.hdfs.roundValue=5
    # 时间上进行”舍弃”的单位,包含:second,minute,hour
    a1.sinks.k1.hdfs.roundUnit=minute

    # Use a channel which buffers events in memory
    a1.channels.c1.type = memory
    a1.channels.c1.capacity = 1000
    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel
    a1.sources.r1.channels = c1
    a1.sinks.k1.channel = c1
    ############################################################
    创建HDFS目录
    hadoop fs -mkdir /flume
    
    启动Flume
    flume-ng agent -n a1 -c conf -f hdfs.conf -Dflume.root.logger=INFO,console

    查看hdfs文件
    hadoop fs -ls /flume/...
    hadoop fs -get /flume/...

作业:
1、flume如何收集java请求数据
2、项目当中如何来做? 日志存放/log/目录下 以yyyyMMdd为子目录 分别存放每天的数据




厦门大学林子雨老师大数据实验环境搭建索引 博客首页 在Windows中使用VirtualBox安装Ubuntu Java和SSH的安装配置 Hadoop 2.7分布式集群环境搭建 Hadoop安装教程_单机/伪分布式配置_Hadoop2.6.0/Ubuntu14.04 Spark快速入门指南 – Spark安装与基础使用 HBase的安装与运行 Ubuntu安装hive,并配置mysql作为元数据库 Ubuntu下Mong... 阅读详情

相关推荐

Flume安装配置

本任务需要使用root用户完成相关配置,已安装Hadoop及需要配置前置环境,具体要求如下:

m0_57883712的博客 799

Apache Flume : 简单案例

采集目录到HDFS 采集需求:服务器的某特定目录下,会不断产生新的文件,每当有新文件出现,就需要把文件采集到HDFS中去 根据需求,首先定义以下3大要素 采集源,即source——监控文件目录 : spooldir 下沉目标,即sink——HDFS文件系统 : hdfs sink source和sink之间的传递通道——channel,可用file channel 也可以用内存channel...

4368

基于飞腾平台的Flume的安装配置

 Flume是一种分布式,可靠且可用的服务,用于高效地收集,汇总和移动大量日志数据。它具有基于流式数据流的简单而灵活的架构。它具有可靠的可靠性机制以及许多故障转移和恢复机制,具有强大的容错性和容错能力。它使用一个简单的可扩展数据模型,允许在线分析应用程序。

developersupport的博客 1405

Flume(二)

Flume(二) flume常见架构 1、单数据源单接口到HDFS集群 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sRICBtiN-1638758418070)(F:\大数据\图片7.png)] [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RiqicdfM-1638758418071)(F:\大数据\图片8.png)] # taildir读取同目录中的多个日志文件 将数据发送到hdfs # 声明组件名称 taildir2hdfs.sou

chaohui2638457321的博客 461

Flume 的安装和使用方法(Spark-2.1.0)

同时,我们把 Flume Sink 类别设置为 avro,绑定到 localhost 的 44444 端口,这样, Flume Source 把采集到的消息汇集到 Flume Sink 以后,Sink 会把消息推送给 localhost 的 44444 端口,而我们编写的 Spark Streaming 程序一直在监听 localhost 的 44444 端口,一 旦有消息到达,就会被 Spark Streaming 应用程序取走进行处理。你可以看到,马上会报错,因为找不到相关的 jar 包。

m0_74972727的博客 2690

flume的安装和配置

Flume是Cloudera提供的日志收集系统,Flume支持在日志系统中定制各类数据发送方,用于收集数据;同时,Flume提供对数据进行简单处理,并写到各种storage。Flume是一个分布式、可靠、和高可用的海量日志采集、聚合和传输的系统。本试验就是通过学习flume工具的安装,为后面学习flume实现对数据信息的采集以便于解决实际中存在的问题打下基础。熟练flume的安装和配置,理解flume的原理和应用本次环境是:Ubuntu16.04 + jdk1.8.0_73 + hadoop-2.7.3+f

需要远程指导仿真实验、代码有问题的,请后台私信或者关注公众号 1万+

Flume学习之监控端口数据(Exec、Spooldir、Taildir)心得

Flume监控端口数据(Exec、Spooldir、Taildir)案例

ljs_0的博客 2039

PCIe Gen4 Switch芯片PM40028调试踩坑实录:从boot引脚设置到串口无输出的诡异问题

本文记录了PCIe Gen4 Switch芯片PM40028的实战调试过程,重点剖析了从boot引脚配置错误导致串口无输出,到使用逻辑分析仪定位并解决启动问题的完整排障思路。文章深入探讨了芯片启动流程、硬件信号测量方法,并总结了高速硬件调试的核心经验与系统性排查清单,为工程师解决类似PCIe Gen4设备调试难题提供实用指南。

i8j9k0l1的博客 253

linux 系统 flume 的安装与使用

目录linux系统flume的安装和使用安装Flume下载安装Flume配置相关文件配置环境变量配置文件启动FLame实例使用Flume接收来自AvroSource的信息使用Flume接收来自NetcatSource的信息 linux系统flume的安装和使用 数据采集是大数据分析全流程中的重要环节,典型的数据采集工具包括ETL工具、日志采集工具(如Flume和Kafla)、数据迁移工具(如Sqoop)等。 本次选择了具有代表性的数据采集工具进行介绍,即日志采集工具Flume。详细介绍了这个工具的安装和使用

weixin_44804824的博客 2049

VMware vSphere运维管理手册

ESXi 7.0 引入了一种系统存储布局,可对大型模块和第三方组件进行灵活的分区管理和支持,同时简化了调试操作。ESXi 7.0 系统存储更改在 ESXi 7.0 之前,分区大小固定不变,除 /scratch 分区和可选 VMFS 数据存储之外,且分区号是静态的,这些限制了分区管理。在 ESXi 7.0 中,分区整合为更少且更大的可扩展分区,具体取决于所使用的引导介质及其容量。ESXi 7.0 系统存储布局包含四个分区:分区适用情况类型系统引导存储引导加载程序和 EFI 模块。FAT16。

Avenjan优快云博客 3627

STM32驱动直流有刷电机:H桥、死区与PWM调速实战

直流有刷电机是嵌入式系统中最基础的执行器之一,其核心控制逻辑围绕H桥拓扑展开——通过四个开关管组合实现启停、正反转与调速。理解死区时间(Dead Time)对防止上下管直通、保障硬件安全至关重要;而PWM调速的本质是调节电机端口平均电压,需结合互补输出与占空比映射实现平滑响应。该技术广泛应用于智能小车、电动工具及工业控制器等场景,尤其在STM32平台配合HAL库与高级定时器(如TIM1)时,可构建高鲁棒性、可复用的电机驱动框架。

weixin_42593701的博客 777

Flume 安装与配置步骤

摘要:本文介绍了Flume的安装配置及使用Kafka作为Sink的完整流程。主要内容包括:1)解压Flume安装包并配置环境变量;2)创建配置目录和编写Kafka Sink配置文件,定义了exec类型的Source、memory类型的Channel和Kafka Sink的参数;3)启动Flume服务并验证进程状态;4)监控Flume运行日志。该配置实现了将/tmp/access.log日志文件通过Flume实时传输到Kafka的logs主题的功能。

2301_80484340的博客 980

【LaTeX PPT模板集】Beamer主题与配色使用教程

【LaTeX PPT模板集】Beamer主题与配色使用教程

Xminyang的博客 1万+

flume安装及配置

Flume安装   介绍 Flume本身的安装比较简单(flume的介绍请参考http://blog.youkuaiyun.com/rzhzhz/article/details/7448633),安装前先说明几个概念,先看flume的架构 1.    Flume分三种角色        Mater:  master负责配置及通信管理,是集群的控制器。        Collector: col

厚积而薄发 1万+

YOLOv11 改进策略 | HWD:引入 Haar 小波变换,减少信息丢失

在卷积神经网络(CNN)中,下采样(Downsampling)是降低特征图分辨率、扩大感受野的关键操作,通常通过最大池化(MaxPool)或步长为 2 的卷积(Strided Convolution)实现。然而,这些方法在降低分辨率的同时,往往会丢失图像中的高频细节信息(如边缘、纹理)和精确的空间位置信息,这可能对后续特征提取和目标检测精度产生不利影响,尤其是对于小目标和需要精细定位的任务。

走向CTO的路上... 1793

基于MySQL的京东用户行为分析

对京东用户行为的分析,利用AARRR模型进行分析。

SelenaSelena的博客 1912

flume的安装配置

4.使用flume-ng version 可查到相关版本信息即安装成功。分发到其他节点并source /etc/profile。# console表示同时将日志输出到控制台。--conf:Flume通用配置目录。--conf-file:配置文件位置。新起一个终端并连接44444端口。3. 修改flume的配置文件。# 配置flume的环境变量。输入hello flume。在flume控制台看到输出。Flume使用demo。--name:代理名称。# 指定日志输出路径。5.flume的使用。

v15220的博客 1383

优快云 付费专栏连载第 3 篇|Cadence Allegro 8 层板布局实战教程:RK3568 硬件模块化分区布局,DDR4 内存约束区域设置、布局禁忌避坑指南

本文是 RK3568 8 层板高速 PCB 设计实战专栏的第 3 篇,聚焦 DDR4 布局阶段的核心方法论与 Allegro 实操。文章从布局前 6 项前置检查清单入手,系统讲解模块化分区布局的五大黄金原则,并给出 160mm×100mm 样板的 5 大功能分区实战案例。随后以图文步骤演示如何在 Allegro 中创建 ROOM_DDR4 与 ROOM_CPU 约束区域,并强调 Hard Room 硬约束的强制校验作用。

weixin_44520581的博客 1734

kafka+flume+aws S3安装与配置

kafka+flume+aws S3安装与配置 一、下载并解压、安装相应的版本 hadoop版本为2.9.2,flume的_本为1.9.0 下载hadoop地址为:https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/common/hadoop-2.9.2/hadoop-2.9.2.tar.gz 下载flume地址:https://mirrors.t...

fct2001140269的博客 2712

一张微服务地图的十年演进:Spring Cloud 核心、扩展与工具组件的定位、原理与选型

本文把 Spring Cloud 当作一张微服务地图来读:先说明它是由 Commons 抽象层、实现层和 Boot 装配层构成的发行版,再沿一次请求梳理注册发现、负载均衡、声明式调用、容错限流、网关、配置、追踪与总线七类核心组件的原理与换代,并扩展到云平台、服务网格、消息流、批处理、安全与周边生态。仿真实测:默认参数下实例宕机平均 242 秒才被感知,优雅下线降到 47 秒;一个慢实例让轮询的 P99 达 49 秒,P2C 仅 203 毫秒。最后给出退场替代表、技术栈组合、升级路线和决策树。

曾经“等你生日那天”都遥远得像未来,如今却可欢愉的挥手说“下个十年见” 169万+

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

sqoop和flume简单安装配置使用

sqoop和flume简单配置安装使用

aj_shang的博客 1868

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

[ 安装 ] Flume安装步骤!

Hive安装步骤一、准备工作二、安装步骤(一)解压(二)配置驱动(三)环境变量配置(四)Jar 包拷贝   前言:下文中的IP地址、文件路径、主机名等,请根据您自己的实际情况,进行修改和配置。 flume-ng-1.6.0-cdh5.14.2.tar.gz 下载链接 提取码:33u0 一、准备工作 安装一台虚拟机(★★★ 虚拟机 CentOS 7的安装步骤 ★★★) 启动一台虚拟机,并连接至Xshell、Xftp(连接方法) 安装、搭建好JDK、MySQL、Hadoop,并做

且陶陶。 1万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

上一篇: Hive篇---Hive使用优化
下一篇: Nginx篇--解读nginx配置
L先生AI课堂
L先生AI课堂 领域专家: 大数据技术领域 领域专家: 大数据技术领域
博客等级 码龄9年 678粉丝 216原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

L先生AI课堂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值