linux下es-head安装及配置

与es同级目录下:

wget https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip master.zip
cd elasticsearch-head-master
npm install –g grunt–cli

因为es是brian账户下的,而我使用的是root账户,所以权限有问题

chown -R brian:root /home/app/elasticsearch/elasticsearch-head-master/

安装

npm install

head安装完成后,将es后台启动、head也运行起来

./elasticsearch-5.5.1/bin/elasticsearch -d 
/home/app/elasticsearch/elasticsearch-head-master下:npm run start

因为es是端口9200,而head插件是9100,,解决跨域问题:

elasticsearch-5x下的 config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"

我是在虚拟机上安装的,使用windows浏览器访问,所以就不能127.0.0.1了,要ip:9200访问

猜你喜欢

转载自www.cnblogs.com/two-bees/p/10804480.html