elasticsearch-head插件安装

1.安装nodejs(如果已经安装过,此步可省略)

wget https://nodejs.org/dist/v8.9.4/node-v8.9.4.tar.gz
tar zxvf node-v8.9.4.tar.gz
cd node-v8.9.4
./configure
make make install

2.安装elasticsearch-head插件

wget https://github.com/mobz/elasticsearch-head/archive/master.zip
unzip master.zip
cd elasticsearch-head-master/
npm install
npm run start

3.修改elasticsearch.yml配置文件,重启elasticsearch

添加以下配置项
http.cors.enabled: true http.cors.allow-origin: "*" http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type

4.登录elasticsearch-head插件界面

登录有两种情况

  • elasticsearch未安装x-pack插件

   打开浏览器,直接输入 http://172.30.154.74:9100/  (ip根据实际情况而定)即可。

  • elasticsearch已安装x-pack插件

   打开浏览器,输入 http://172.30.154.74:9100/?auth_user=elastic&auth_password=changeme 

注意:如果elasticsearch已安装x-pack插件也可以通过配置关闭x-pack。在elasticsearch.yml配置文件中添加 xpack.security.enabled: false,此时head插件无需用户名密码即可登录。

红色框内输入相应url,连接es集群

参考文档:

https://nodejs.org/en/download/

http://blog.csdn.net/zt_fucker/article/details/73090365

https://github.com/mobz/elasticsearch-head

原文地址:https://www.cnblogs.com/libin2015/p/8462555.html