Flume is a distributed, reliable, and available service for efficiently collecting, aggregating, and moving large amounts of log data. It has a simple and flexible architecture based on streaming data flows. It is robust and fault tolerant with tunable reliability mechanisms and many failover and recovery mechanisms. It uses a simple extensible data model that allows for online analytic application.

翻译:

Flume是一种分布式、可靠且可用的服务,用于高效地收集、聚合和移动大量日志数据。它具有基于流数据流的简单灵活的体系结构。它具有鲁棒性和容错性,具有可调的可靠性机制和许多故障转移和恢复机制。它使用一个简单的可扩展数据模型,允许在线分析应用程序。

web Server 端产生日志,Source到具体目录下获取日志文件,把日志Channel中,Sink写到HDFS上

Source → Channel  可以进行数据清洗

Channel → Sink      可以进行数据清洗

vent是Flume数据传输的基本单元
Flume以事件的形式将数据从源头传送到最终的目的
Event由可选的header和载有数据的一个byte array构成
     载有的数据对flume是不透明的
     Header是容纳了key-value字符串对的无序集合,key在集合内是唯 一的。
     Header可以在上下文路由中使用扩展

前提依赖:

* 运行在有log的地方

* 运行在LINUX

* JVM

解压:flume-ng-1.5.0-cdh5.3.6.tar.gz

mv apache-flume-1.5.0-cdh5.3.6-bin/  flume-1.5.0-cdh5.3.6

cd /home/hadoop/CDH5.3.6/flume-1.5.0-cdh5.3.6/conf

cp flume-env.sh.template  flume-env.sh

vi flume-env.sh

export JAVA_HOME=/usr/local/jdk1.
[hadoop@master flume-1.5.-cdh5.3.6]$ bin/flume-ng 

Usage: bin/flume-ng <command> [options]...

commands:
agent run a Flume agent
avro-client run an avro Flume client
version show Flume version info global options:
--conf,-c <conf> use configs in <conf> directory-Dproperty=value sets a Java system property value agent options:
--name,-n <name> the name of this agent (required)
--conf-file,-f <file> specify a config file (required if -z missing)

运行命令:

bin/flume-ng agent --conf conf --name agent-test --conf-file test.conf

bin/flume-ng agent -c conf  -n agent-test -f test.conf

配置一个a.conf

# 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' ###define agent
a1.sources = r1
a1.channels = c1
a1.sinks = k1 ### define sources
a1.sources.r1.type = netcat
a1.sources.r1.bind = master
a1.sources.r1.port = ### define channel
a1.channels.c1.type = memory
a1.channels.c1.capacity =
a1.channels.c1.transactionCapacity = ### define sink
a1.sinks.k1.type=logger
a1.sinks.k1.maxBytyesToLog = ### bind the source and sinks to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

安装 xinetd

[root@master telnet]# ll
total 224
----rwxr-x. 1 hadoop hadoop 59120 Jun 22 23:49 telnet-0.17-47.el6_3.1.x86_64.rpm
----rwxr-x. 1 hadoop hadoop 37748 Jun 22 23:49 telnet-server-0.17-47.el6_3.1.x86_64.rpm
----rwxr-x. 1 hadoop hadoop 124280 Jun 22 23:49 xinetd-2.3.14-38.el6.x86_64.rpm
[root@master telnet]# rpm -ivh *.rpm
warning: telnet-0.17-47.el6_3.1.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:xinetd ########################################### [ 33%]
2:telnet-server ########################################### [ 67%]
3:telnet ########################################### [100%]
[root@master telnet]#

启动服务:

[root@master telnet]# /etc/rc.d/init.d/xinetd  restart
Stopping xinetd: [FAILED]
Starting xinetd: [ OK ]
[root@master telnet]#

运行命令:

bin/flume-ng agent -c conf -n a1 -f conf/a.conf -D flume.root.logger=DEBUG,consol

查看端口:

[root@master flume-1.5.0-cdh5.3.6]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.1.30:19888 0.0.0.0:* LISTEN 3735/java
tcp 0 0 0.0.0.0:10033 0.0.0.0:* LISTEN 3735/java
tcp 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN 2715/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1924/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1685/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2299/master
tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN 2815/java
tcp 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN 2815/java
tcp 0 0 192.168.1.30:10020 0.0.0.0:* LISTEN 3735/java
tcp 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN 2815/java
tcp 0 0 192.168.1.30:9000 0.0.0.0:* LISTEN 2715/java
tcp 0 0 192.168.1.30:50090 0.0.0.0:* LISTEN 2990/java
tcp 0 0 :::22 :::* LISTEN 1924/sshd
tcp 0 0 ::1:631 :::* LISTEN 1685/cupsd
tcp 0 0 ::1:25 :::* LISTEN 2299/master
tcp 0 0 ::ffff:192.168.1.30:44444 :::* LISTEN 17488/java
tcp 0 0 :::3306 :::* LISTEN 2152/mysqld

运行命令:bin/flume-ng agent -c conf -n a1 -f conf/a.conf -Dflume.root.logger=DEBUG,console

在另一个控制台

[hadoop@master ~]$ telnet master 44444
Trying 192.168.1.30...
Connected to master.
Escape character is '^]'.
hello flume
OK
hello world
OK

在控制台的运行命令下,会出现:

CHD-5.3.6集群上Flume安装的更多相关文章

  1. CHD-5.3.6集群上Flume的文件监控

    收集hive的log     hive的运行日志:    /home/hadoop/CDH5.3.6/hive-0.13.1-cdh5.3.6/log/hive.log * memory *hdfs  ...

  2. CHD-5.3.6集群上oozie安装

    参考文档:http://archive.cloudera.com/cdh5/cdh/5/oozie-4.0.0-cdh5.3.6/DG_QuickStart.html tar -zxvf  oozie ...

  3. CHD-5.3.6集群上sqoop安装

    Sqoop(发音:skup)是一款开源的工具,主要用于在Hadoop(Hive)与传统的数据库(mysql.postgresql...)间进行数据的传递,可以将一个关系型数据库(例如 : MySQL ...

  4. CHD-5.3.6集群上hive安装

    解压过后: [hadoop@master CDH5.3.6]$ ls -rlttotal 8drwxr-xr-x. 17 hadoop hadoop 4096 Jun  2 16:07 hadoop- ...

  5. hive1.2.1安装步骤(在hadoop2.6.4集群上)

    hive1.2.1在hadoop2.6.4集群上的安装 hive只需在一个节点上安装即可,这里再hadoop1上安装 1.上传hive安装包到/usr/local/目录下 2.解压 tar -zxvf ...

  6. 在Ubuntu16.04集群上手工部署Kubernetes

    目前Kubernetes为Ubuntu提供的kube-up脚本,不支持15.10以及16.04这两个使用systemd作为init系统的版本. 这里详细介绍一下如何以非Docker方式在Ubuntu1 ...

  7. 在集群上运行caffe程序时如何避免Out of Memory

    不少同学抱怨,在集群的GPU节点上运行caffe程序时,经常出现"Out of Memory"的情况.实际上,如果我们在提交caffe程序到某个GPU节点的同时,指定该节点某个比较 ...

  8. 分布式Hbase-0.98.4在Hadoop-2.2.0集群上的部署

    fesh个人实践,欢迎经验交流!本文Blog地址:http://www.cnblogs.com/fesh/p/3898991.html Hbase 是Apache Hadoop的数据库,能够对大数据提 ...

  9. Hadoop集群上使用JNI,调用资源文件

    hadoop是基于java的数据计算平台,引入第三方库,例如C语言实现的开发包将会大大增强数据分析的效率和能力. 通常在是用一些工具的时候都要用到一些配置文件.资源文件等.接下来,借一个例子来说明ha ...

随机推荐

  1. code review 20190705

    命名规范: 做了什么? 目的是什么? 在什么基础上进行? 注释说明 sql update,where 先行????? 警告: 清空所有警告:所有隐藏比较深入的bug,都是由警告带来的 + 忽略警告 枚 ...

  2. PAT 甲级 1016 Phone Bills (25 分) (结构体排序,模拟题,巧妙算时间,坑点太多,debug了好久)

    1016 Phone Bills (25 分)   A long-distance telephone company charges its customers by the following r ...

  3. CPU 上下文切换及案例分析

    什么是CPU 上下文 我们都知道,Linux是一个多任务操作系统,它远支持大于CPU数量的任务同时运行,当然,这些任务实际上并不是真的在同时运行,而是因为系统在很短时间内,将CPU轮流分配给他们,造成 ...

  4. postman使用当前时间戳

    //设置当前时间戳postman.setGlobalVariable(“time”,Math.round(new Date().getTime()));time = postman.getGlobal ...

  5. error_reporting函数引起的error_log配置失效的问题

    由于项目代码中大量使用了error_reporting(0);导致php.ini中的error_log失效,不记录错误日志, 导致调试起来非常不便,耗费大量的时间,所以在php.ini的配置中禁止掉e ...

  6. C-LODOP的端口和网站的端口

    c-lodop的端口和网站的端口是不同的,不需要修改自己网站的端口.c-lodop32位标准版端口:8000,18000 (http网站)c-lodop32扩展版端口:8000,18000(http网 ...

  7. Spring Aop(五)——给Advice传参

    转发:https://www.iteye.com/blog/elim-2395337 5 给Advice传递参数 Advice除了可以接收JoinPoint(非Around Advice)或Proce ...

  8. Note 2: Complain

    Note 2: Complain 1. The collection of Linkun's [1]: 1.1suck If someone says that something sucks, th ...

  9. ElasticSearch 获取es集群信息

    参考博客:https://www.cnblogs.com/phpshen/p/8668833.html es集群信息有些版本下如果证书过期就会查不到,有些版本貌似不需要,提供一个据说不需要证书的版本的 ...

  10. VSCode插件Prettier配置

    参考链接:https://blog.csdn.net/wengou3033/article/details/88749448 Prettier格式化配置