<commit_before>---
layout: article
title:  "流式计算flume-kafka-sparkstreaming案例(一)"
categories: hadoop
toc: true
image:
    teaser: /teaser/spark.png
---

> 这篇内容主要介绍流式计算之Flume阶段




### 前言
&emsp;&emsp;
{% highlight bash %}
{% raw %}
# memory channel called ch1 on web1
web1.channels.ch1.type = memory
web1.channels.ch1.capacity=500000
web1.channels.ch1.transactionCapacity=5000

# Define a tail source<commit_msg>no message<commit_after>---
layout: article
title:  "流式计算flume-kafka-sparkstreaming案例(一)"
categories: hadoop
toc: true
image:
    teaser: /teaser/spark.png
---

> 这篇内容主要介绍流式计算之Flume阶段




### 前言
&emsp;&emsp;
## 先看下流式计算和离线计算的结构图：
![架构图](/images/hadoop/flume/flume1.png)

{% highlight bash %}
{% raw %}
# memory channel called ch1 on web1
web1.channels.ch1.type = memory
web1.channels.ch1.capacity=500000
web1.channels.ch1.transactionCapacity=5000

# Define a tail source
{'fraction_non_alphanumeric': 0.13765642775881684, 'fraction_numerical': 0.04209328782707622, 'mean_word_length': 4.67741935483871, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3954072', 'n_tokens_mistral': 405, 'n_tokens_neox': 389, 'n_words': 66}