日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

flume linux 命令,Linux环境Flume安装配置及使用

發(fā)布時(shí)間:2025/3/12 linux 15 豆豆
生活随笔 收集整理的這篇文章主要介紹了 flume linux 命令,Linux环境Flume安装配置及使用 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

# Flume監(jiān)聽本地Linux-hive日志文件采集到HDFS——配置文件

# Name the components on this agent agent別名設(shè)置

a1.sources = r1

a1.sinks = k1

a1.channels = c1

# Describe/configure the source 設(shè)置數(shù)據(jù)源監(jiān)聽本地文件配置

# exec 執(zhí)行一個(gè)命令的方式去查看文件 tail -F 實(shí)時(shí)查看

a1.sources.r1.type = exec

# 要執(zhí)行的腳本command tail -F 默認(rèn)10行 man tail 查看幫助

# 監(jiān)聽hive操作日志

a1.sources.r1.command = tail -F /tmp/root/hive.log

# 執(zhí)行這個(gè)command使用的是哪個(gè)腳本 -c 指定使用什么命令

# whereis bash

# bash: /usr/bin/bash /usr/share/man/man1/bash.1.gz

a1.sources.r1.shell = /usr/bin/bash -c

# Describe the sink 設(shè)置sink

# 指定sink類型

a1.sinks.k1.type = hdfs

# 指定HDFS路徑 %Y%m%d/%H%M%S 日期時(shí)間 ————修改項(xiàng)

a1.sinks.k1.hdfs.path = hdfs://bigdata01:9000/flume/%Y%m%d/%H-%M

#上傳文件的前綴

a1.sinks.k1.hdfs.filePrefix = logs-

#是否按照時(shí)間滾動(dòng)文件夾

a1.sinks.k1.hdfs.round = true

#多少時(shí)間單位創(chuàng)建一個(gè)新的文件夾 秒 (默認(rèn)30s)

a1.sinks.k1.hdfs.roundValue = 1

#重新定義時(shí)間單位(每分鐘滾動(dòng)一個(gè)文件夾)

a1.sinks.k1.hdfs.roundUnit = minute

#是否使用本地時(shí)間戳

a1.sinks.k1.hdfs.useLocalTimeStamp = true

#積攢多少個(gè) Event 才 flush 到 HDFS 一次

a1.sinks.k1.hdfs.batchSize = 500

#設(shè)置文件類型,可支持壓縮

a1.sinks.k1.hdfs.fileType = DataStream

#多久生成一個(gè)新的文件 秒

a1.sinks.k1.hdfs.rollInterval = 30

#設(shè)置每個(gè)文件的滾動(dòng)大小 字節(jié)(最好128M)

a1.sinks.k1.hdfs.rollSize = 134217700

#文件的滾動(dòng)與 Event 數(shù)量無關(guān)

a1.sinks.k1.hdfs.rollCount = 0

#最小冗余數(shù)(備份數(shù) 生成滾動(dòng)功能則生效roll hadoop本身有此功能 無需配置) 1份 不冗余

a1.sinks.k1.hdfs.minBlockReplicas = 1

# Use a channel which buffers events in memory 設(shè)置channel 使用內(nèi)存 總大小1000 每次傳輸100

a1.channels.c1.type = memory

a1.channels.c1.capacity = 1000

a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel 指定channel

a1.sources.r1.channels = c1

a1.sinks.k1.channel = c1

復(fù)制代碼

總結(jié)

以上是生活随笔為你收集整理的flume linux 命令,Linux环境Flume安装配置及使用的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。