ES 5.0以上版本中不支持直接安装head插件,需要启动一个服务。
head插件是一个nodejs的工程,因此需要先安装nodejs,使用npm来安装依赖的包。
这里使用了淘宝的cnpm来加速~
which yum &> /dev/null && yum install nodejs -y
which apt-get &> /dev/null && apt-get install nodejs -y
npm install -g cnpm --registry=https://registry.npm.taobao.org
#请根据具体情况修改elasticsearch.yml并重庆elasticsearch服务。
cat >> /etc/elasticsearch/elasticsearch.yml << EOF
http.cors.enabled: true
http.cors.allow-origin: "*"
EOF
service elasticsearch restart
cd ~
git clone https://github.com/mobz/elasticsearch-head
cd ~/elasticsearch-head
cnpm install
sed -i "/port: 9100,/i\\\t\t\t\t\thostname: '0.0.0.0'," Gruntfile.js
grunt server &
本文详细介绍在ES5.0及以上版本中如何通过安装NodeJS和使用cnpm来部署Head插件,包括配置elasticsearch.yml,启动服务等关键步骤。
4065

被折叠的 条评论
为什么被折叠?



