forked from ianunruh/monitoring
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall-graylog2-server.sh
executable file
·41 lines (31 loc) · 1.05 KB
/
install-graylog2-server.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
#!/bin/bash
##
# Installs the Graylog2 server
#
# Graylog2 requires an entire Elasticsearch cluster to itself, so this script will overwrite
# the Elasticsearch config to change the cluster name. Configured with the username `admin`
# and the password `password`.
#
# Provides:
# - HTTP REST API (TCP/12900)
#
# Dependencies:
# - Elasticsearch (0.90.x)
# - MongoDB
##
set -eux
source env.sh
apt-get install -yq openjdk-7-jre-headless
cd /tmp
useradd -s /bin/false -d /var/lib/graylog2 -m graylog2
mkdir -p /var/log/graylog2
chown graylog2:graylog2 /var/log/graylog2
curl -sOL https://github.com/Graylog2/graylog2-server/releases/download/${GRAYLOG_VERSION}/graylog2-server-${GRAYLOG_VERSION}.tgz
tar xf graylog2-server-${GRAYLOG_VERSION}.tgz
cp -R graylog2-server-${GRAYLOG_VERSION} /usr/share/graylog2-server
mkdir -p /etc/graylog2
cp $BASE_PATH/etc/graylog2/server.conf /etc/graylog2
cp $BASE_PATH/etc/init/graylog2-server.conf /etc/init
cp $BASE_PATH/etc/elasticsearch/graylog2/elasticsearch.yml /etc/elasticsearch
service elasticsearch restart
start graylog2-server