当前位置:网站首页>Flume common commands and basic operations
Flume common commands and basic operations
2022-07-05 12:33:00 【JKing_ one hundred and sixty-eight】
flume There are three major categories of components :
source Components , specify data source channel Components , As a cache , Connect source and sink sink Components , Specify the data destination
Case study 1: Use flume Acquisition from 44444 Data from port
1) Ready to configure
# Declare three components a1 = agent1
a1.sources = r1
a1.channels = c1
a1.sinks = k1
# Definition source Information
# r1 type , What kind of data to monitor
a1.sources.r1.type = netcat
# monitor ip
a1.sources.r1.bind = 192.168.88.161
# Port number
a1.sources.r1.port = 44444
# r1 Connect to c1
a1.sources.r1.channels = c1
# Definition channel Information
a1.channels.c1.type = memory
# Definition sink Information
# Set the type Print... In the terminal
a1.sinks.k1.type = logger
# To which channel
a1.sinks.k1.channel = c1
2) Write configuration
1) open flume The installation directorycd /export/server/apache-flume-1.9.0-bin/conf
2) Create a profiletouch intro_source_netcat_sink_logger.conf
3) hold Top configuration Write to file ( Remember to delete the Chinese Notes )vim intro_source_netcat_sink_logger.conf
3) start-up Flume
flume-ng agent -f /export/server/apache-flume-1.9.0-bin/conf/intro_source_netcat_sink_logger.conf -n a1 -Dflume.root.logger=INFO,console
4) towards 44444 Port send data
# install telnet
yum install telnet
# towards 44444 Port send data
telnet 192.168.88.161 44444
Case study 2: Use flume Acquisition from kafka The data of
1) Ready to configure
a1.sources = r1
a1.channels = c1
a1.sinks = k1
a1.sources.r1.type = TAILDIR
a1.sources.r1.channels = c1
a1.sources.r1.positionFile = /export/data/momo_data/taildir_position.json
a1.sources.r1.filegroups = f1
a1.sources.r1.filegroups.f1 = /export/data/momo_data/MOMO_DATA.dat
a1.channels.c1.type = memory
a1.sinks.k1.type=org.apache.flume.sink.kafka.KafkaSink
a1.sinks.k1.kafka.bootstrap.servers=node1:9092,node2:9092,node3:9092
a1.sinks.k1.kafka.topic=MOMO_MSG
a1.sinks.k1.channel=c1
2) Write configuration
1) open flume The installation directorycd /export/server/apache-flume-1.9.0-bin/conf
2) Create a profiletouch intro_source_netcat_sink_logger.conf
3) hold Top configuration Write to file ( Remember to delete the Chinese Notes )vim intro_source_netcat_sink_logger.conf
3) Use flume Acquisition from kafka The data of
1) start-up kafkanohup kafka-server-start.sh /export/server/kafka_2.12-2.4.1/config/server.properties&
2) establish topicskafka-topics.sh --create --bootstrap-server node1.itcast.cn:9092 --topic MOMO_MSG --partitions 3 --replication-factor 2
3) start-up flumeflume-ng agent -f /export/server/apache-flume-1.9.0-bin/conf/source_taildir_sink_kafka.conf -n a1 -Dflume.root.logger=INFO,console
4) start-up kafka consumer Through this, the consumer checks that the data is actually written to this MOMO_MSGkafka-console-consumer.sh --bootstrap-server node1.itcast.cn:9092 --topic MOMO_MSG
5) Start production data jarcd /export/data/momo_init/ java -jar MoMo_DataGen.jar MoMo_Data.xlsx /export/data/momo_data/ 1000
边栏推荐
- ZABBIX monitors mongodb templates and configuration operations
- PXE启动配置及原理
- MySQL regular expression
- Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
- Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
- POJ-2499 Binary Tree
- Intern position selection and simplified career development planning in Internet companies
- How does MySQL execute an SQL statement?
- Take you two minutes to quickly master the route and navigation of flutter
- Redis clean cache
猜你喜欢
[figure neural network] GNN from entry to mastery
NPM install reports an error
Interviewer: is acid fully guaranteed for redis transactions?
Get the variable address of structure member in C language
Matlab boundarymask function (find the boundary of the divided area)
Reinforcement learning - learning notes 3 | strategic learning
16 channel water lamp experiment based on Proteus (assembly language)
Detailed steps for upgrading window mysql5.5 to 5.7.36
Take you hand in hand to develop a service monitoring component
Redis highly available slice cluster
随机推荐
C alarm design
MySQL trigger
Learn the memory management of JVM 02 - memory allocation of JVM
How does MySQL execute an SQL statement?
Detailed steps for upgrading window mysql5.5 to 5.7.36
byte2String、string2Byte
信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
Introduction to GNN
Making and using the cutting tool of TTF font library
Simple production of wechat applet cloud development authorization login
How to design an interface?
mysql拆分字符串做条件查询
GPS数据格式转换[通俗易懂]
Matlab imoverlay function (burn binary mask into two-dimensional image)
Conversion du format de données GPS [facile à comprendre]
Migrate data from Mysql to neo4j database
7月华清学习-1
ZABBIX monitors mongodb templates and configuration operations
Swift - enables textview to be highly adaptive
GPS數據格式轉換[通俗易懂]