08【線上日誌分析】之Flume Agent(聚合節點) sink to kafka cluster
1.建立logtopic
[root@sht-sgmhadoopdn-01 kafka]# bin/kafka-topics.sh --create --zookeeper 172.16.101.58:2181,172.16.101.59:2181,172.16.101.60:2181/kafka --replication-factor 3 --partitions 1 --topic logtopic
2.建立avro_memory_kafka.properties (kafka sink)
[root@sht-sgmhadoopcm-01 ~]# cd /tmp/flume-ng/conf
[root@sht-sgmhadoopcm-01 conf]# cp avro_memory_hdfs.properties avro_memory_kafka.properties
[root@sht-sgmhadoopcm-01 conf]# vi avro_memory_kafka.properties
# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1
# Describe/configure the source
a1.sources.r1.type = avro
a1.sources.r1.bind = 172.16.101.54
a1.sources.r1.port = 4545
# Describe the sink
a1.sinks.k1.type = org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.kafka.topic = logtopic
a1.sinks.k1.kafka.bootstrap.servers = 172.16.101.58:9092,172.16.101.59:9092,172.16.101.60:9092
a1.sinks.k1.kafka.flumeBatchSize = 6000
a1.sinks.k1.kafka.producer.acks = 1
a1.sinks.k1.kafka.producer.linger.ms = 1
a1.sinks.ki.kafka.producer.compression.type = snappy
# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.keep-alive = 90
a1.channels.c1.capacity = 2000000
a1.channels.c1.transactionCapacity = 6000
# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1
3.後臺啟動 flume-ng agent(聚合節點)和檢視nohup.out
[root@sht-sgmhadoopcm-01 ~]# source /etc/profile
[root@sht-sgmhadoopcm-01 ~]# cd /tmp/flume-ng/
[root@sht-sgmhadoopcm-01 flume-ng]# nohup flume-ng agent -c conf -f /tmp/flume-ng/conf/avro_memory_kafka.properties -n a1 -Dflume.root.logger=INFO,console &
[1] 4971
[root@sht-sgmhadoopcm-01 flume-ng]# nohup: ignoring input and appending output to `nohup.out'
[root@sht-sgmhadoopcm-01 flume-ng]#
[root@sht-sgmhadoopcm-01 flume-ng]#
[root@sht-sgmhadoopcm-01 flume-ng]# cat nohup.out
4.檢查log收集的三臺(收集節點)開啟沒
[hdfs@flume-agent-01 flume-ng]$ . ~/.bash_profile
[hdfs@flume-agent-02 flume-ng]$ . ~/.bash_profile
[hdfs@flume-agent-03 flume-ng]$ . ~/.bash_profile
[hdfs@flume-agent-01 flume-ng]$ nohup flume-ng agent -c /tmp/flume-ng/conf -f /tmp/flume-ng/conf/exec_memory_avro.properties -n a1 -Dflume.root.logger=INFO,console &
[hdfs@flume-agent-01 flume-ng]$ nohup flume-ng agent -c /tmp/flume-ng/conf -f /tmp/flume-ng/conf/exec_memory_avro.properties -n a1 -Dflume.root.logger=INFO,console &
[hdfs@flume-agent-01 flume-ng]$ nohup flume-ng agent -c /tmp/flume-ng/conf -f /tmp/flume-ng/conf/exec_memory_avro.properties -n a1 -Dflume.root.logger=INFO,console &
5.開啟kafka manager監控
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2132060/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 04【線上日誌分析】之Flume Agent的3臺收集+1臺聚合到hdfs的搭建
- 05【線上日誌分析】之Kafka 0.10.1.0 Cluster的搭建和Topic簡單操作實驗Kafka
- 11【線上日誌分析】之redis-3.2.5 install(單節點)Redis
- 節點2線上日誌生成歸檔日誌在節點1上的初步分析
- Flume + Kafka + SparkStreaming分析KafkaSpark
- 02【線上日誌分析】之基於Flume-ng Exec Source開發自定義外掛AdvancedExecSource
- 25【線上日誌分析】之基於Flume-ng Exec Source開發自定義外掛ExecSource_JSONJSON
- 21【線上日誌分析】之記錄一個flume-ng的tail -f引數所誘發的血案AI
- 07【線上日誌分析】之kafka-manager監控工具的搭建(sbt安裝與編譯)Kafka編譯
- Flume-ng HDFS sink原理解析
- Flume 整合 Kafka_flume 到kafka 配置【轉】Kafka
- 06【線上日誌分析】之KafkaOffsetMonitor監控工具的搭建Kafka
- 16【線上日誌分析】之grafana-4.1.1 Install和新建日誌分析的DashBoardGrafana
- 18【線上日誌分析】之Spark on Yarn配置日誌Web UI(HistoryServer服務)SparkYarnWebUIServer
- Kafka實戰-Flume到KafkaKafka
- 大資料03-整合 Flume 和 Kafka 收集日誌大資料Kafka
- 22【線上日誌分析】之專案第二階段概述
- 00【線上日誌分析】之專案概述和GitHub專案地址Github
- Kafka實戰-Kafka ClusterKafka
- 17【線上日誌分析】之使用IDEA將工程Build成jar包IdeaUIJAR
- kafka+flume的整合Kafka
- 收集、分析線上日誌資料實戰——ELK
- Flink kafka source & sink 原始碼解析Kafka原始碼
- 12【線上日誌分析】之RedisLive監控工具的詳細安裝Redis
- 19【線上日誌分析】之sparkdemo.jar執行在yarn上過程SparkJARYarn
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- redis cluster節點/新增刪除操作Redis
- Flink的sink實戰之二:kafkaKafka
- Oracle 線上日誌管理Oracle
- 線上日誌損壞
- Flume+Kafka收集Docker容器內分散式日誌應用實踐KafkaDocker分散式
- oracle 12c flex cluster專題 之 節點角色轉換OracleFlex
- zabbix agent 日誌檔案輪詢分析
- 24【線上日誌分析】之Tomcat的支援log4j,日誌輸出為json格式TomcatJSON
- 23【線上日誌分析】之改造CDH的HDFS的NN,DN程式,日誌輸出為json格式JSON
- flume自定義 ES SINk外掛,AVRO格式資料寫入ESVR
- KafKa+Zookeeper+Flume部署指令碼Kafka指令碼
- 非線上日誌丟失