flume-ng 集群搭脚本

#!/bin/bash

# author: xirong 
# date  :  2015-02-06 

#####  搭建 flume 集群的脚本
#    注意:
#   1. 需要 jdk7 环境,如果没有 Java 环境,请配置
#   2. 有 /home/work 目录,否则无法安装
#
####

# 压缩文件解压
tar -zxf apache-flume-1.5.2-bin.tar.gz -C /home/work/flume_cluster/

# 配置flume环境
echo '## flume configuration ' >> /etc/profile
echo 'export FLUME_HOME=/home/work/flume_cluster/apache-flume-1.5.2-bin' >> /etc/profile
echo 'export PATH=.:$PATH::$FLUME_HOME/bin' >> /etc/profile

source /etc/profile

# 添加Java 环境变量
\cp -f $FLUME_HOME/conf/flume-env.sh.template $FLUME_HOME/conf/flume-env.sh
echo 'JAVA_HOME=/opt/jdk1.7.0_75/' >> $FLUME_HOME/conf/flume-env.sh

echo 'confgratulations! fluem has been installed and flume-env.sh has been set!'

# 测试是否成功 
flume-ng version

## Flume 1.5.2
## Source code repository: https://git-wip-us.apache.org/repos/asf/flume.git
## Revision: 229442aa6835ee0faa17e3034bcab42754c460f5
## Compiled by hshreedharan on Wed Nov 12 12:51:22 PST 2014
## From source with checksum 837f81bd1e304a65fcaf8e5f692b3f18

 

你可能感兴趣的:(flume-ng 集群搭脚本)