Flume 1.7 Installing and running under Windows
- Install Java and configure environment variables.
- Install Flume,flume's official website http://flume.apache.org/, after downloading the direct decompression can.
Second, the operation
Create a configuration file: Create a example.conf under the extracted file apache-flume-1.6.0-bin/conf, as follows.
# example.conf:a single-node Flume configuration # Name the components on ThisAgent A1.sources=R1 a1.sinks=K1 a1.channels=C1 # Describe/Configure the source A1.sources.r1.type=netcat A1.sources.r1.bind=localhost a1.sources.r1.port= 44444# Describe The sink a1.sinks.k1.type=Logger # Use a channel which buffers events in memory A1.channels.c1.type=Memory A1.channels.c1.capacity= 1000a1.channels.c1.transactionCapacity= 100# Bind The source and sink to the channel A1.sources.r1.channels=C1 A1.sinks.k1.channel= C1
Configuration Description: Sources configuration:
- Netcat monitors a port to enter each text line data flowing through the port as an event input
- Bind is to add an IP address or host name
- Port where the bound host is to be added
Flume Module Sinks Configuration:
- A1.sinks.k1.type=logger logger data to log file (print out)
Flume Mode channels Configuration:
- A1.channels.c1.type=memory
- a1.channels.c1.capacity=1000
- a1.channels.c1.transactioncapacity=100
Momory event data is stored in memory, cache data 1000 cached data is 1000 100 maximum number of units per thing cache flume Module channel configuration: (Configuration sources, The relationship between sinks file and channel) A1.SOURCES.R1.CHANNELS=C1A1.SINKS.K1.CHANNEL=C1
2.1. Open cmd to enter the Apache-flume-1.6.0-bin\bin directory, run the following command.
Flume-ng.cmd agent-conf. /conf -conf-file. /conf/example.conf -name A1 -property Flume.root.logger=info,console
(Right-click to view the original):
2.2. Open a CMD window and run the following command.
telnet localhost 44444
If the connection succeeds, the window changes to input state and you can enter text. The information received is also displayed in the cmd window in step 2. (Right-click to view the original):
Flume 1.7 Installation and operation under Windows