Flume installation and configuration, and flume installation Configuration
FlumeInstallation and configuration
0. Follow jdk.
Download the jdk-1.8.0 and apache-flume Binary packages
Set the software path as follows:
Jdk: // usr/local/jdk-1.8.0
Flume:/opt/apache-flume
1. Configure flume-env.sh
Cd/opt/apache-flume-1.8.0/confcp flume-env.sh.template flume-env.sh // point to JAVAecho "export JAVA_HOME =/usr/local/jdk1.8.0 _ 162/"> flume-env.sh
2. Edit the configuration file (vim default. conf)
# Set the loglog of the Configuration group. sinks = sklog. sources = sclog. channels = ch # configure sourceslog. sources. SC. type = exec # source type: command log. sources. SC. command = tail-F/data/log/access. log # configure sinkslog. sinks. sk. type = org. apache. flume. sink. kafka. kafkaSinklog. sinks. sk. kafka. topic = testlog. sinks. sk. kafka. bootstrap. servers = localhost: 9092 # configure channels. Record checkpointlog. channels. ch. type = file log. channels. ch. checkpointDir =/data/flume/checklog. channels. ch. dataDirs =/data/flume/data # bind source and sink to channlelog. sinks. sk. channel = chlog. sources. SC. channel = ch
3. Start flume
cd /opt/apache-flume-1.8.0bin/flume-ng agent --conf conf --conf-file conf/default.conf -name log
4. Start kafka and listen for output data