forked from ianunruh/monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-flume.sh
executable file
·42 lines (32 loc) · 940 Bytes
/
install-flume.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
##
# Installs Apache Flume
#
# Provides:
# - Avro receiver (TCP/41414)
# - Syslog receiver (TCP/1514)
#
# Dependencies:
# - Elasticsearch
##
set -eux
source env.sh
# Prepare user and directories
useradd -d /opt/flume -M flume
mkdir -p /etc/flume/conf.d /var/lib/flume /var/log/flume
chown flume:flume /var/lib/flume /var/log/flume
# Install Java runtime
apt-get update -q
apt-get install -yq openjdk-7-jre-headless
# Install Flume
cd /tmp
curl -sOL http://apache.osuosl.org/flume/${FLUME_VERSION}/apache-flume-${FLUME_VERSION}-bin.tar.gz
tar xf apache-flume-${FLUME_VERSION}-bin.tar.gz
mv apache-flume-${FLUME_VERSION}-bin /opt/flume
# Copy libraries necessary for the Elasticsearch sink
cp /usr/share/elasticsearch/lib/lucene-* /opt/flume/lib
cp /usr/share/elasticsearch/lib/elasticsearch-* /opt/flume/lib
# Configure Flume
cp $BASE_PATH/etc/flume/* /etc/flume
cp $BASE_PATH/etc/init/flume.conf /etc/init
start flume