问题描述 

 解决办法

  先把这个hdfs目录下的数据删除。并修改配置文件flume-conf.properties,重新采集。

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License. # The configuration file needs to define the sources,
# the channels and the sinks.
# Sources, channels and sinks are defined per agent,
# in this case called 'agent' agent1.sources = spool-source1
agent1.sinks = hdfs-sink1
agent1.channels = ch1 #Define and configure an Spool directory source
agent1.sources.spool-source1.channels=ch1
agent1.sources.spool-source1.type=spooldir
agent1.sources.spool-source1.spoolDir=/home/hadoop/data/flume/sqooldir//--/
agent1.sources.spool-source1.ignorePattern=event(_\d{}\-d{}\-d{}\_d{}\_d{})?\.log(\.COMPLETED)?
agent1.sources.spool-source1.deserializer.maxLineLength= #Configure channel
agent1.channels.ch1.type = file
agent1.channels.ch1.checkpointDir = /home/hadoop/data/flume/checkpointDir
agent1.channels.ch1.dataDirs = /home/hadoop/data/flume/dataDirs #Define and configure a hdfs sink
agent1.sinks.hdfs-sink1.channel = ch1
agent1.sinks.hdfs-sink1.type = hdfs
agent1.sinks.hdfs-sink1.hdfs.path = hdfs://master:9000/flume/%Y%m%d
agent1.sinks.hdfs-sink1.hdfs.useLocalTimeStamp = true
agent1.sinks.hdfs-sink1.hdfs.rollInterval =
agent1.sinks.hdfs-sink1.hdfs.rollSize =
agent1.sinks.hdfs-sink1.hdfs.rollCount =
agent1.sinks.hdfs-sink1.hdfs.minBlockReplicas=
agent1.sinks.hdfs-sink1.hdfs.idleTimeout=
#agent1.sinks.hdfs-sink1.hdfs.codeC = snappy
agent1.sinks.hdfs-sink1.hdfs.fileType=DataStream
#agent1.sinks.hdfs-sink1.hdfs.writeFormat=Text # For each one of the sources, the type is defined
#agent.sources.seqGenSrc.type = seq # The channel can be defined as follows.
#agent.sources.seqGenSrc.channels = memoryChannel # Each sink's type must be defined
#agent.sinks.loggerSink.type = logger #Specify the channel the sink should use
#agent.sinks.loggerSink.channel = memoryChannel # Each channel's type is defined.
#agent.channels.memoryChannel.type = memory # Other config values specific to each type of channel(sink or source)
# can be defined as well
# In this case, it specifies the capacity of the memory channel
#agent.channels.memoryChannel.capacity =

  教大家一招:大家在这些如flume的配置文件,最好还是去看官网,学会扩展,别只局限于别人的博客的文档,当然可以作为参考。关键还是来源于官方!

[hadoop@master sqooldir]$ $HADOOP_HOME/bin/hadoop fs -rm -r /flume/
// :: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
// :: INFO fs.TrashPolicyDefault: Namenode trash configuration: Deletion interval = minutes, Emptier interval = minutes.
Deleted /flume/
[hadoop@master sqooldir]$

  重新开启flume

[hadoop@master flume]$ pwd
/home/hadoop/app/flume
[hadoop@master flume]$ bin/flume-ng agent -n agent1 -f conf/flume-conf.properties

  如果你的问题,还有副本数的问题,自行去解决。将$HADOOP_HOME/etc/hadoop/下的hdfs-site.xml的属性(master、slave1和slave2都要修改)

<property>
<name>dfs.replication</name>
<value></value>
<description>Set to for pseudo-distributed mode,Set to for distributed mode,Set to for distributed mode.</description>
</property>

  记得重启hadoop集群。

flume中sink到hdfs,文件系统频繁产生文件和出现乱码,文件滚动配置不起作用?的更多相关文章

  1. flume中sink到hdfs,文件系统频繁产生文件,文件滚动配置不起作用?

    在测试hdfs的sink,发现sink端的文件滚动配置项起不到任何作用,配置如下: a1.sinks.k1.type=hdfs a1.sinks.k1.channel=c1 a1.sinks.k1.h ...

  2. HDFS文件系统上传时序图 PB级文件存储时序图

    自己设计的时序图. 来自为知笔记(Wiz)

  3. 大数据学习笔记之Hadoop(二):HDFS文件系统

    文章目录 一 HDFS概念 1.1 概念 1.2 组成 1.3 HDFS 文件块大小 二 HFDS命令行操作 三 HDFS客户端操作 3.1 eclipse环境准备 3.1.1 jar包准备 3.2 ...

  4. Flume中的HDFS Sink配置参数说明【转】

    转:http://lxw1234.com/archives/2015/10/527.htm 关键字:flume.hdfs.sink.配置参数 Flume中的HDFS Sink应该是非常常用的,其中的配 ...

  5. Flume监听文件目录sink至hdfs配置

    一:flume介绍 Flume是一个分布式.可靠.和高可用的海量日志聚合的系统,支持在系统中定制各类数据发送方,用于收集数据:同时,Flume提供对数据进行简单处理,并写到各种数据接受方(可定制)的能 ...

  6. Flume实时监控目录sink到hdfs,再用sparkStreaming监控hdfs的这个目录,对数据进行计算

    目标:Flume实时监控目录sink到hdfs,再用sparkStreaming监控hdfs的这个目录,对数据进行计算 1.flume的配置,配置spoolDirSource_hdfsSink.pro ...

  7. 在Spark shell中基于HDFS文件系统进行wordcount交互式分析

    Spark是一个分布式内存计算框架,可部署在YARN或者MESOS管理的分布式系统中(Fully Distributed),也可以以Pseudo Distributed方式部署在单个机器上面,还可以以 ...

  8. 我理解中的Hadoop HDFS分布式文件系统

    一,什么是分布式文件系统,分布式文件系统能干什么 在学习一个文件系统时,首先我先想到的是,学习它能为我们提供什么样的服务,它的价值在哪里,为什么要去学它.以这样的方式去理解它之后在日后的深入学习中才能 ...

  9. 将存储在本地的大量分散的小文件,合并并保存在hdfs文件系统中

    import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java ...

随机推荐

  1. jquery on event

    <!doctype html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  2. NodeJS学习笔记 (14)URL查询字符串-querystring(ok)

    模块概述 在nodejs中,提供了querystring这个模块,用来做url查询参数的解析,使用非常简单. 模块总共有四个方法,绝大部分时,我们只会用到 .parse(). **.stringify ...

  3. rsync---远程数据同步工具

    rsync命令是一个远程数据同步工具,可通过LAN/WAN快速同步多台主机间的文件.rsync使用所谓的“rsync算法”来使本地和远程两个主机之间的文件达到同步,这个算法只传送两个文件的不同部分,而 ...

  4. Laravel API 允许跨域访问

    服务器A请求服务器B的接口,那么一般会出现跨域问题.全解跨域请求处理办法 XMLHttpRequest cannot load http://api.console.vms3.com/api/user ...

  5. Python学习笔记(4)--数据结构之元组tuple

    元组(tuple) 定义:tuple和list十分相似,但是tuple是不可变的,即不能修改tuple 初始化:(), ('a', ) , ('a', 'b')   //当只有一个元素时,需加上逗号, ...

  6. EXPIREAT

    EXPIREAT key timestamp EXPIREAT 的作用和EXPIRE类似,都用于为key设置生存时间. 不同在于EXPIREAT命令接受都时间参数是UNIX时间戳(unix times ...

  7. Win7下JDK环境变量设置批处理(转)

    每次重装系统之后,都需要重新设置JDK环境变量 项目中有些入门小白看了网络上的设置环境变量的文章还是会设置错环境变量 提供一个批处理能够在Win7下运行(使用了setx命令),自动设置环境变量. cl ...

  8. 泛泰A820L (高通MSM8660 cpu) 3.4内核的CM10.1(Android 4.2.2) 測试版第二版

    欢迎关注泛泰非盈利专业第三方开发团队 VegaDevTeam  (本team 由 syhost suky zhaochengw(z大) xuefy(大星星) tenfar(R大师) loogeo cr ...

  9. ios提交程序后出现的各种问题

    提交了几次都被feedback.下面均为本人碰到过得问题.希望对大家解决提交问题有帮助 Number    one:PLA 3.3.12 We found your app uses the iOS ...

  10. android ViewPager实现 跑马灯切换图片+多种切换动画

    近期在弄个项目.要求有跑马灯效果的图片展示. 网上搜了一堆,都没有完美实现的算了还是自己写吧! 实现原理利用 ViewPager 控件,这个控件本身就支持滑动翻页非常好非常强大好多功能都能用上它.利用 ...