Flume+Kafka+SparkStreaming+Hbase+可视化(一)

一、前置准备:

Linux命令基础

Scala、Python其中一门

Hadoop、Spark、Flume、Kafka、Hbase基础知识

二、分布式日志收集框架Flume

业务现状分析:服务器、web服务产生的大量日志,怎么使用,怎么将大量日志导入到集群

1、shell脚本批量,再传到Hdfs:实效性不高,容错率低,网络/磁盘IO,监控

2、Flume:

Flume:关键在于写配置文件

1)配置 agent

2)配置 Source

3)配置 Channel

4)配置 Sink

1-netcat-mem-logger.conf :监听端口数据

#example for source=netcat, channel=memory, sink=logger
# Name the components on this agent
a1.sources = r1
a1.channels = c1
a1.sinks = k1

# configure for sources
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# configure for channels
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# configure for sinks
a1.sinks.k1.type = logger

# configure
a1.sinks.k1.channel = c1
a1.sources.r1.channels = c1

启动 flume-ng agent \

-n a1 \

-c conf -f ./1-netcat-mem-logger.conf \

-Dflume.root.logger=INFO,console

exec-mem-logger.conf :监控文件

# Name the components on this agent
a1.sources = r1
a1.channels = c1
a1.sinks = k1

# configure for sources
a1.sources.r1.type = exec
a1.sources.r1.command = tail -F /opt/datas/flume_data/exec_tail.log

# configure for channels
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# configure for sinks
a1.sinks.k1.type = logger
a1.sinks.k1.channel = c1
a1.sources.r1.channels = c1

flume-ng agent \

-n a1 \

-c conf -f ./4-exec-mem-logger.conf \

-Dflume.root.logger=INFO,console

日志收集过程:

1. 日志服务器,启动agent,exec-source, memory-channel,avro-sink(数据服务器), 将收集到的日志数据,写到数据服务器

2. 数据服务器,启动agent,avro-aource,memory-channel,logger-sink/kafka-sink

conf1:exec-mem-avro.conf

# Name the components on this agent
a1.sources = exec-source
a1.channels = memory-channel
a1.sinks = avro-sink

# configure for sources
a1.sources.exec-source.type = exec
a1.sources.exec-source.command = tail -F /opt/datas/log-collect-system/log_server.log

# configure for channels
a1.channels.memory-channel.type = memory
a1.channels.memory-channel.capacity = 1000
a1.channels.memory-channel.transactionCapacity = 100

# configure for sinks
a1.sinks.avro-sink.type = avro
a1.sinks.avro-sink.hostname = localhost
a1.sinks.avro-sink.port = 44444

# configure
a1.sinks.avro-sink.channel = memory-channel
a1.sources.exec-source.channels = memory-channel

conf2:avro-mem-logger.conf

# Name the components on this agent
a1.sources = avro-source
a1.channels = memory-channel
a1.sinks = logger-sink

# configure for sources
a1.sources.avro-source.type = avro
a1.sources.avro-source.bind = localhost
a1.sources.avro-source.port = 44444

# configure for channels
a1.channels.memory-channel.type = memory
a1.channels.memory-channel.capacity = 1000
a1.channels.memory-channel.transactionCapacity = 100

# configure for sinks
a1.sinks.logger-sink.type = logger

# configure
a1.sinks.logger-sink.channel = memory-channel
a1.sources.avro-source.channels = memory-channel

(非常重要!!!)启动顺序:先启动exec-mem-avro.conf再启动exec-mem-avro.conf

原文地址:https://www.cnblogs.com/mlxx9527/p/9367495.html

时间: 2024-08-05 23:48:12

Flume+Kafka+SparkStreaming+Hbase+可视化(一)的相关文章

flume + kafka + sparkStreaming + HDFS 构建实时日志分析系统

一.Hadoop配置安装 注意:apache提供的hadoop-2.6.0的安装包是在32位操作系统编译的,因为hadoop依赖一些C++的本地库, 所以如果在64位的操作上安装hadoop-2.4.1就需要重新在64操作系统上重新编译 1.修改Linux主机名 2.修改IP 3.修改主机名和IP的映射关系 ######注意######如果你们公司是租用的服务器或是使用的云主机(如华为用主机.阿里云主机等) /etc/hosts里面要配置的是内网IP地址和主机名的映射关系 4.关闭防火墙 5.s

大数据平台架构(flume+kafka+hbase+ELK+storm+redis+mysql)

上次实现了flume+kafka+hbase+ELK:http://www.cnblogs.com/super-d2/p/5486739.html 这次我们可以加上storm: storm-0.9.5简单配置如下: 安装依赖 wget http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz tar zxvf jdk-8u45-linux-x64.tar.gz cd jdk-8u45-linux-

Flume+Kafka+Storm+Redis构建大数据实时处理系统:实时统计网站PV、UV+展示

[TOC] 1 大数据处理的常用方法 前面在我的另一篇文章中<大数据采集.清洗.处理:使用MapReduce进行离线数据分析完整案例>中已经有提及到,这里依然给出下面的图示: 前面给出的那篇文章是基于MapReduce的离线数据分析案例,其通过对网站产生的用户访问日志进行处理并分析出该网站在某天的PV.UV等数据,对应上面的图示,其走的就是离线处理的数据处理方式,而这里即将要介绍的是另外一条路线的数据处理方式,即基于Storm的在线处理,在下面给出的完整案例中,我们将会完成下面的几项工作: 1

Flume+Kafka+Storm+Redis 大数据在线实时分析

1.实时处理框架 即从上面的架构中我们可以看出,其由下面的几部分构成: Flume集群 Kafka集群 Storm集群 从构建实时处理系统的角度出发,我们需要做的是,如何让数据在各个不同的集群系统之间打通(从上面的图示中也能很好地说明这一点),即需要做各个系统之前的整合,包括Flume与Kafka的整合,Kafka与Storm的整合.当然,各个环境是否使用集群,依个人的实际需要而定,在我们的环境中,Flume.Kafka.Storm都使用集群. 2. Flume+Kafka整合 2.1 整合思路

flume+kafka+storm+mysql架构设计

前段时间学习了storm,最近刚开blog,就把这些资料放上来供大家参考. 这个框架用的组件基本都是最新稳定版本,flume-ng1.4+kafka0.8+storm0.9+mysql (项目是maven项目,需要改动mysql配置,提供两种topology:读取本地文件(用来本地测试):读取服务器日志文件.) (是visio画的,图太大,放上来字看起来比较小,如果有需要的朋友留邮箱) 实时日志分析系统架构简介 系统主要分为四部分:                         负责从各节点上

kafka+storm+hbase

kafka+storm+hbase实现计算WordCount. (1)表名:wc (2)列族:result (3)RowKey:word (4)Field:count 1.解决: (1)第一步:首先准备kafka.storm和hbase相关jar包.依赖如下: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&qu

[转载] 利用flume+kafka+storm+mysql构建大数据实时系统

原文: http://mp.weixin.qq.com/s?__biz=MjM5NzAyNTE0Ng==&mid=205526269&idx=1&sn=6300502dad3e41a36f9bde8e0ba2284d&key=c468684b929d2be22eb8e183b6f92c75565b8179a9a179662ceb350cf82755209a424771bbc05810db9b7203a62c7a26&ascene=0&uin=Mjk1ODMy

Flume+Kafka+Strom基于分布式环境的结合使用

目录: 一.Flume.Kafka.Storm是什么,如何安装? 二.Flume.Kafka.Storm如何结合使用? 1) 原理是什么? 2) Flume和Kafka的整合  3) Kafka和Storm的整合  4) Flume.Kafka.Storm的整合    一.Flume.Kafka.Storm是什么,如何安装? Flume的介绍,请参考这篇文章<Flume1.5.0的安装.部署.简单应用> Kafka的介绍,请参考这篇文章<kafka2.9.2的分布式集群安装和demo(j

flume+kafka+hdfs构建实时消息处理系统

flume是一个实时消息收集系统,它定义了多种的source.channel.sink,可以根据实际情况选择. Flume下载及文档: http://flume.apache.org/ Kafka kafka是一种高吞吐量的分布式发布订阅消息系统,她有如下特性: 通过O(1)的磁盘数据结构提供消息的持久化,这种结构对于即使数以TB的消息存储也能够保持长时间的稳定性能. 高吞吐量:即使是非常普通的硬件kafka也可以支持每秒数十万的消息. 支持通过kafka服务器和消费机集群来分区消息. 支持Ha