linux安装es-head

1安装npm

curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
yum install -y nodejs
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install
npm run build
npm -v

2 安装head插件

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

权限

chown -R root: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

需要后台启动执行
#nohup npm run start &

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

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

发表评论