国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

佛山網(wǎng)站設(shè)計多少錢而的跟地seo排名點擊軟件

佛山網(wǎng)站設(shè)計多少錢,而的跟地seo排名點擊軟件,太倉做網(wǎng)站公司,建設(shè)摩托車型號大全文章作者郵箱:yugongshiyesina.cn 地址:廣東惠州 ▲ 本章節(jié)目的 ? 了解Interceptor的概念和配置參數(shù); ? 掌握Interceptor的使用方法; ? 掌握Interceptor的Host Interceptor; ? 掌握Interceptor的…

文章作者郵箱:yugongshiye@sina.cn? ? ? ? ? ? ? 地址:廣東惠州

?▲ 本章節(jié)目的

??了解Interceptor的概念和配置參數(shù);

??掌握Interceptor的使用方法;

??掌握Interceptor的Host Interceptor;

??掌握Interceptor的Static Interceptor;

??掌握Interceptor的UUID Interceptor;

??掌握Interceptor的Search And Replace Interceptor;

??掌握Interceptor的Regex Filtering Interceptor;

??掌握Interceptor的Custom Interceptor;

一、Timestamp Interceptor

1.?概述

1. Timestamp Interceptor是在headers中來添加一個timestamp字段來標(biāo)記數(shù)據(jù)被收集的時間。

2. Timestamp Interceptor結(jié)合HDFS Sink可以實現(xiàn)數(shù)據(jù)按天存儲。

2.?配置屬性

屬性

解釋

type

timestamp

3.?案例

1. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 給Interceptor起名

a1.sources.s1.interceptors = i1

# 指定Timestamp Interceptor

a1.sources.s1.interceptors.i1.type = timestamp

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

4.?數(shù)據(jù)按天存放

1. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = hadoop01

a1.sources.s1.port = 8090

a1.sources.s1.interceptors = i1

a1.sources.s1.interceptors.i1.type = timestamp

a1.channels.c1.type = memory

a1.sinks.k1.type = hdfs

a1.sinks.k1.hdfs.path = hdfs://hadoop01:9000/flumedata/date=%Y-%m-%d

a1.sinks.k1.hdfs.fileType = DataStream

a1.sinks.k1.hdfs.rollInterval = 3600

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f hdfsin.conf -

Dflume.root.logger=INFO,console

二、Host Interceptor

1.?概述

1. Host Interceptor是在headers中添加一個字段host。

2. Host Interceptor可以用于標(biāo)記數(shù)據(jù)來源于哪一臺主機(jī)。

2.?配置屬性

屬性

解釋

type

必須是host

3.?案例

1. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 給Interceptor起名

a1.sources.s1.interceptors = i1 i2

# 指定Timestamp Interceptor

a1.sources.s1.interceptors.i1.type = timestamp

# 指定Host Interceptor

a1.sources.s1.interceptors.i2.type = host

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

三、Static Interceptor

1.?概述

1. Static Interceptor是在headers中添加指定字段。

2. 可以利用這個Interceptor來標(biāo)記數(shù)據(jù)的類型。

2.?配置屬性

屬性

解釋

type

必須是static

key

指定在headers中的字段名

value

指定在headers中的字段值

3.?案例

1. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 給Interceptor起名

a1.sources.s1.interceptors = i1 i2 i3

# 指定Timestamp Interceptor

a1.sources.s1.interceptors.i1.type = timestamp

# 指定Host Interceptor

a1.sources.s1.interceptors.i2.type = host

# 指定Static Interceptor

a1.sources.s1.interceptors.i3.type = static

a1.sources.s1.interceptors.i3.key = kind

a1.sources.s1.interceptors.i3.value = log

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

四、UUID Interceptor

1.?概述

1. UUID Interceptor是在headers中添加一個id字段。

2. 可以用于標(biāo)記數(shù)據(jù)的唯一性。

2.?配置屬性

屬性

解釋

type

必須是org.apache.flume.sink.solr.morphline.UUIDInterceptor$Builder

3.?案例

1. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 給Interceptor起名

a1.sources.s1.interceptors = i1 i2 i3 i4

# 指定Timestamp Interceptor

a1.sources.s1.interceptors.i1.type = timestamp

# 指定Host Interceptor

a1.sources.s1.interceptors.i2.type = host

# 指定Static Interceptor

a1.sources.s1.interceptors.i3.type = static

a1.sources.s1.interceptors.i3.key = kind

a1.sources.s1.interceptors.i3.value = log

# 指定UUID Interceptor

a1.sources.s1.interceptors.i4.type = org.apache.flume.sink.solr.morphline.UUIDInterceptor$Builder

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f in.conf -

Dflume.root.logger=INFO,console

五、Search And Replace Interceptor

1.?概述

1. Search And Replace Interceptor在使用的時候,需要指定正則表達(dá)式,會根據(jù)正則表達(dá)式的規(guī)則,將符合正則表達(dá)式的數(shù)據(jù)替換為指定形式的數(shù)據(jù)。

2. 在替換的時候,不會替換headers中的數(shù)據(jù),而是會替換body中的數(shù)據(jù)。

2.?配置屬性

屬性

解釋

type

必須是search_replace

searchPattern

指定要匹配的正則形式

replaceString

指定要替換的字符串

3.?案例

1. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = http

a1.sources.s1.port = 8090

# 給攔截器起名

a1.sources.s1.interceptors = i1

# 指定類型

a1.sources.s1.interceptors.i1.type = search_replace

a1.sources.s1.interceptors.i1.searchPattern = [0-9]

a1.sources.s1.interceptors.i1.replaceString = *

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f searchin.conf -

Dflume.root.logger=INFO,console

六、Regex Filtering Interceptor

1.?概述

1. Regex Filtering Interceptor在使用的時候需要指定正則表達(dá)式。

2. 屬性excludeEvents的值如果不指定,默認(rèn)是false。

3. 如果沒有配置excludeEvents的值或者配置excludeEvents的值配置為false,則只有符合正則表達(dá)式的數(shù)據(jù)會留下來,其他不符合正則表達(dá)式的數(shù)據(jù)會被過濾掉;如果excludeEvents的值,那么符合正則表達(dá)式的數(shù)據(jù)會被過濾掉,其他的數(shù)據(jù)則會被留下來。

2.?配置屬性

屬性

解釋

type

必須是regex_filter

regex

指定正則表達(dá)式

excludeEvents

true或者false

3.?案例

1. 編寫格式文件,添加如下內(nèi)容:

# 定義 數(shù)據(jù)源(輸入端) 緩沖區(qū) 輸出源(輸出端)

a1.sources = r1

a1.channels = c1

a1.sinks = k1

# 輸入端

a1.sources.r1.type = spooldir

a1.sources.r1.spoolDir = /opt/upload

a1.sources.r1.fileSuffix = .done

# 攔截器

a1.sources.r1.interceptors = i1

a1.sources.r1.interceptors.i1.type = regex_filter

#全部都是符合條件的數(shù)據(jù)

a1.sources.r1.interceptors.i1.regex = ^.*INFO.*$

#排除符合正則表達(dá)式的數(shù)據(jù)

# a1.sources.r1.interceptors.i1.excludeEvents = true

# 輸出端

a1.sinks.k1.type = hdfs

a1.sinks.k1.hdfs.path = hdfs://flume45:9000/interceptors/%Y%m%d/%H

#是否使用本地時間戳

a1.sinks.k1.hdfs.useLocalTimeStamp = true

# 序列化

a1.sinks.k1.hdfs.fileType = DataStream

a1.sinks.k1.hdfs.rollInterval = 0

# 使用一個在內(nèi)存中緩沖事件的通道

a1.channels.c1.type = memory

# 連接通道

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

2.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f regexin.conf -

Dflume.root.logger=INFO,console

七、Custom Interceptor

1.?概述

1. 在Flume中,也允許自定義攔截器。但是不同于其他組件,自定義Interceptor的時候,需要再額外覆蓋其中的內(nèi)部接口。

2. 步驟:

a. 構(gòu)建Maven工程,導(dǎo)入對應(yīng)的依賴。

b. 自定義一個類實現(xiàn)Interceptor接口,覆蓋其中initialize,intercept和close方法。

c. 定義靜態(tài)內(nèi)部類,實現(xiàn)Interceptor.Builder內(nèi)部接口。

d. 打成jar包方法Flume安裝目錄的lib目錄下。

e. 編寫格式文件,添加如下內(nèi)容:

a1.sources = s1

a1.channels = c1

a1.sinks = k1

a1.sources.s1.type = netcat

a1.sources.s1.bind = 0.0.0.0

a1.sources.s1.port = 8090

# 指定攔截器

a1.sources.s1.interceptors = i1

a1.sources.s1.interceptors.i1.type = cn.tedu.flume.interceptor.AuthInterceptor$Builder

a1.channels.c1.type = memory

a1.sinks.k1.type = logger

a1.sources.s1.channels = c1

a1.sinks.k1.channel = c1

f.?啟動Flume:

../bin/flume-ng agent -n a1 -c ../conf -f authin.conf -

Dflume.root.logger=INFO,console

http://m.aloenet.com.cn/news/35126.html

相關(guān)文章:

  • 廣州網(wǎng)站開發(fā)企業(yè)網(wǎng)絡(luò)推廣的方法有哪些
  • 國內(nèi)做網(wǎng)站建設(shè)好的一起來看在線觀看免費
  • wordpress的url電腦優(yōu)化軟件哪個好用
  • 做網(wǎng)站的貼吧網(wǎng)絡(luò)營銷的步驟
  • 代辦公司注冊靠譜嗎優(yōu)化大師 win10下載
  • 靠做網(wǎng)站可以賺錢么想要網(wǎng)站推廣版
  • 網(wǎng)站域名在哪買近一周的新聞大事熱點
  • 備案時暫時關(guān)閉網(wǎng)站交換鏈接營銷的典型案例
  • 有哪些做任務(wù)網(wǎng)站學(xué)好seo
  • 濱州網(wǎng)站建設(shè)公司本周時事新聞概要10條
  • 網(wǎng)站做鏈輪會被懲罰嗎公司網(wǎng)站推廣方法
  • wordpress 換域名 全站301重定向百度熱搜榜小說排名
  • png圖片可以做網(wǎng)站圖標(biāo)嗎建設(shè)網(wǎng)站需要多少錢
  • 河源城鄉(xiāng)規(guī)劃建設(shè)局網(wǎng)站軟文新聞發(fā)布網(wǎng)站
  • 動態(tài)網(wǎng)站開發(fā)參考資料google建站推廣
  • 自己建的網(wǎng)站可以用筆記本做服務(wù)器嗎sem專員
  • 泗洪網(wǎng)站設(shè)計公司ip域名查詢網(wǎng)站入口
  • 抖音代運營排名seo公司排行
  • 主流網(wǎng)站風(fēng)格精品成品網(wǎng)站入口
  • 網(wǎng)站開發(fā)實訓(xùn)報告參考文獻(xiàn)國內(nèi)真正的永久免費建站
  • 免費看電影的網(wǎng)站是什么快速收錄網(wǎng)
  • 怎樣做網(wǎng)站開發(fā)搜索優(yōu)化seo
  • 網(wǎng)站站長統(tǒng)計代碼百度風(fēng)云搜索榜
  • 蘇州專業(yè)做網(wǎng)站公司有哪些如何進(jìn)行電子商務(wù)網(wǎng)站推廣
  • 高端做網(wǎng)站做網(wǎng)站要多少錢
  • wordpress網(wǎng)站服務(wù)器深圳市seo點擊排名軟件價格
  • 河北通信建設(shè)有限公司網(wǎng)站搜索引擎優(yōu)化什么意思
  • 上海網(wǎng)站設(shè)計服務(wù)商長尾詞挖掘免費工具
  • 網(wǎng)站開發(fā)論文需要寫什么windows優(yōu)化大師怎么使用
  • wordpress短視頻主題上海整站seo