forked from ianunruh/monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-oculus.sh
More file actions
executable file
·54 lines (39 loc) · 1.24 KB
/
install-oculus.sh
File metadata and controls
executable file
·54 lines (39 loc) · 1.24 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
##
# Installs Oculus, the metric correlation component of Etsy's Kale stack
#
# Provides:
# - HTTP (TCP/3000)
#
# Dependencies:
# - Elasticsearch (0.90.x)
# - Redis
##
set -eux
source env.sh
useradd -b /opt oculus
mkdir -p /var/log/oculus
chown oculus:oculus /var/log/oculus
apt-get install -yq ruby ruby-dev build-essential git openjdk-7-jdk libxml2-dev libxslt1-dev
gem install rake bundler --no-ri --no-rdoc
git clone git://github.com/etsy/oculus.git /opt/oculus
# Compile and install Oculus plugin for Elasticsearch
cp -R /opt/oculus/resources/elasticsearch-oculus-plugin /usr/share/elasticsearch
cd /usr/share/elasticsearch/elasticsearch-oculus-plugin
rake build
cp OculusPlugins.jar ../lib
cp $BASE_PATH/etc/elasticsearch/oculus/elasticsearch.yml /etc/elasticsearch
service elasticsearch restart
# Configure Oculus
cp $BASE_PATH/opt/oculus/config/config.yml /opt/oculus/config
# Install dependencies for Resque workers and Sinatra web app
cd /opt/oculus
bundle install
# Configure Resque
cp $BASE_PATH/opt/oculus/Rakefile /opt/oculus
# Configure and start services
cp $BASE_PATH/etc/init/oculus* /etc/init
service oculus-resque start
service oculus-webapp start
# Configure cron job
cp $BASE_PATH/etc/cron.d/oculus-import /etc/cron.d