Preparatory work:
1.apache Download Flume
2. Unzip the Flume
3. Modify flume-env.sh, configure Java_home
Netcat Capture Demo:
1. Create the netcat-logger.conf in conf
# defines the name of each component in the agent a1.sources = r1a1.sinks = K1a1.channels = c1# Describe and configure the source component: R1a1.sources.r1.type = Netcata1.sources.r1.bind = Localhosta1.sources.r1.port = 44444 # Describes and configures the sink component: K1a1.sinks.k1.type = logger# describes and configures the channel component, Here is how the memory cache is used A1.channels.c1.type = memorya1.channels.c1.capacity = Span style= "color: #800080;" >1000 a1.channels.c1.transactioncapacity = 100 # describes and configures the connection relationship between the source channel sink a1.sources.r1.channels = C1a1.sinks.k1.channel = C1
2. Start the agent to collect data
Bin/flume-ng agent-c conf-f conf/netcat-logger.conf-n A1 -dflume.root.logger=info,console
-C conf Specifies the directory where the configuration files of the flume itself
-F Conf/netcat-logger.con Specify the acquisition scheme we describe
-N A1 Specify the name of our agent
3. Testing
telnet localhost 44444
Flume NetCat Demo