Flume 知識點(六)Flume 的監控

2022-07-14 15:36:17 字數 897 閱讀 6114

使用 flume 實時收集日誌的過程中,儘管有事務機制保證資料不丟失,但仍然需要時刻關注 source、channel、sink 之間的訊息傳輸是否正常。

比如,soucechannel 傳輸了多少訊息,channelsink 又傳輸了多少,兩處的訊息量是否偏差過大等等。

flume 為我們提供了 monitor 的機制: 通過reporting 的方式,把過程中的counter都列印出來。

flume 可以報告它的 metrics 到 ganglia3,只要你在啟動 flume agent 的時候設定一些引數即可,也可以把這些引數設定在 flume-env.sh 配置檔案中。需要設定的引數如下,這些引數的字首如下flume.monitoring:

啟動flume agent:

$ bin/flume-ng agent --conf-file example.conf --name a1 -dflume.monitoring.type=ganglia -dflume.monitoring.hosts=com.example:1234,com.example2:5455
flume 也可以報告 json 格式的 report,為了開啟 json report,在 flume 機器上啟動了乙個 web server。需要在客戶端啟動時設定以下引數:

type 該元件的名稱,這裡設定為http

port 該服務監聽的埠,預設是41414

啟動flume agent:

flume-ng agent --conf-file example.conf --name a1 -dflume.monitoring.type=http -dflume.monitoring.port=34545
然後通過http://:/metrics來檢視值

Flume 知識總結

flume是cloudera提供的乙個高可用的,高可靠的,分布式的海量日誌採集 聚合和傳輸的系統,flume支援在日誌系統中定製各類資料傳送方,用於收集資料 同時,flume提供對資料進行簡單處理,並寫到各種資料接受方 可定製 的能力。source負責接收events或通過特殊機制產生events,...

flume案例 網路資料採集 Flume的配置

開發配置檔案 根據資料採集的需求配置採集方案,描述在配置檔案中 檔名可任意自定義 配置我們的網路收集的配置檔案 在flume的conf目錄下新建乙個配置檔案 採集方案 vim export servers apache flume 1.8.0 bin conf netcat logger.conf ...

Matlab知識點(六)

使用matlab處理積分問題 最值問題 在matlab 中只有求極 或最 小值命令的函式 若要求函式 f x 在 x1,x2 內的極 或最 大值,可轉化為求 f x 在 x1,x2 內的極 或最 小值 求極 或最 小值點和極 或最 小值的呼叫格式是 x,fual fminbnd fun x1,x2 ...