安装java sdk
wget http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/jdk-8u181-linux-x64.rpm

rpm -ivh jdk-8u181-linux-x64.rpm

设置系统环境

JAVA_HOME=/usr/java/jdk1.7.0
JRE_HOME=/usr/java/jdk1.7.0/jre
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME PATH CLASSPATH

安装elasticsearch
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch

vim /etc/yum.repos.d/elasticsearch.repo

[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1

yum install elasticsearch

启动服务
chkconfig --add elasticsearch

chkconfig elasticsearch on

service elasticsearch start

service elasticsearch status

测试
curl -X GET localhost:9200

下载并安装elasticsearch-head

安装nodejs和npm

yum install epel-release
yum install nodejs npm
git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
npm install
npm install phantomjs-prebuilt@2.1.14 --ignore-script
npm install

#启动
npm run start

#或者
grunt server