#########JDK#############
#!/bin/bash
yum remove jdk -y
wget http://192.168.3.200/rpm/jdk-8u151-linux-x64.rpm
rpm -ivh jdk-8u151-linux-x64.rpm
echo "
export JAVA_HOME=/usr/java/jdk1.8.0_151
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH" >>/etc/profile
source /etc/profile
#########################elasticsearch-head#####################
#!/bin/bash
####主机ip
hostip="192.168.100.100"
##创建插件目录
mkdir /es-head
##进入到目录
cd /es-head/
##下载head包
wget https://github.com/mobz/elasticsearch-head/archive/master.zip
##安装unzip命令
yum install unzip -y
###部署node
wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
tar -xf node-v4.4.7-linux-x64.tar.gz
echo "export PATH=/es-head/node-v4.4.7-linux-x64/bin:$PATH" >> /etc/profile
source /etc/profile
###进入head目录,安装grunt
cd elasticsearch-head-master/
sed -i "s/localhost/${hostip}/g" _site/app.js
##下载运行head必要的文件(放置在文件夹/tmpi)
cd /tmp/
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
cd /es-head/elasticsearch-head-master
npm install
###启动
nohup npm run start &