下载flume二进制安装包:apache-flume-1.6.0-bin.tar.gz
把apache-flume-1.6.0-bin.tar.gz文件存放在/opt/beh/core目录下,进行解压:
tar -zxvf apache-flume-1.6.0-bin.tar.gz
改名:
mv apache-flume-1.6.0-bin flume
l 设置环境变量
export FLUME_HOME=/opt/beh/core/flume
export PATH=$PATH:$ FLUME_HOME/bin
l 配置参数文件
配置文件存放在$FLUME_HOME/conf/目录下,将flume-env.sh.template文件名称改为flume-env.sh
mv flume-env.sh.template flume-env.sh
配置内容如下:
# Licensed to the Apache Software Foundation (ASF) under one# or more contributor license agreements. See the NOTICE file# distributed with this work for additional information# regarding copyright ownership. The ASF licenses this file# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with the License. You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License. # If this file is placed at FLUME_CONF_DIR/flume-env.sh, it will be sourced# during Flume startup. # Enviroment variables can be set here. # export JAVA_HOME=/usr/lib/jvm/java-6-sun # Give Flume more memory and pre-allocate, enable remote monitoring via JMX export JAVA_OPTS="-Xms1024m -Xmx4096m -Dcom.sun.management.jmxremote" # Note that the Flume conf directory is always included in the classpath.#FLUME_CLASSPATH=""
配置说明:
JAVA_OPTS:设置flume启动agent时JVM分配的最小内存和最大内存,根据机器配置尽量设置大一点。
l 验证是否安装成功
进入$FLUME_HOME/bin路径下,执行:flume-ng version ,如果显示版本号说明安装成功。