forked from jagonteam/complete-me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap_root.sh
executable file
·56 lines (40 loc) · 1.36 KB
/
bootstrap_root.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# constants
ES_VERSION=1.5.1
#=================#
# basic dev tools #
#=================#
apt-get update
apt-get install -y vim curl git byobu build-essential htop
#========#
# nodejs #
#========#
apt-get install -y python-software-properties python g++ make
add-apt-repository -y ppa:chris-lea/node.js
apt-get update
apt-get install -y nodejs
npm update -g npm
npm install -g bower gulp
chown -R vagrant:vagrant /home/vagrant/.npm
#===============#
# Elasticsearch #
#===============#
## install java
apt-get install -y openjdk-7-jre-headless
## install elasticsearch
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.deb
dpkg -i elasticsearch-${ES_VERSION}.deb
service elasticsearch start
## install es plugins
X_PROXY=
if [ ! -z "${HTTP_PROXY}" ]
then
proxy_hostport=$(echo $HTTP_PROXY | awk -F/ '{print $3}')
proxy_host=$(echo $proxy_hostport | awk -F: '{print $1}')
proxy_port=$(echo $proxy_hostport | awk -F: '{print $2}')
X_PROXY="`echo '-DproxyPort='``echo ${proxy_port}` `echo '-DproxyHost='``echo ${proxy_host}`"
fi
/usr/share/elasticsearch/bin/plugin ${X_PROXY} -install mobz/elasticsearch-head
/usr/share/elasticsearch/bin/plugin ${X_PROXY} -install elasticsearch/marvel/latest
## restart es
service elasticsearch restart