Elasticsearch-head插件安装

前提

已安装:Elasticsearch, Node.js


引用

Elasticsearch安装教程:https://blog.csdn.net/qq_24271463/article/details/89414701
Node.js安装教程:https://blog.csdn.net/qq_24271463/article/details/89416007


安装

一、安装Grunt
[root@localhost local]# npm install -g grunt-cli
[root@localhost elasticsearch-head-master]# npm install grunt --save-dev
[root@localhost local]# ln -s /usr/local/nodejs/bin/grunt /usr/local/bin/grunt
[root@localhost local]# grunt -version
grunt-cli v1.3.2
二、安装head插件
  1. 下载,解压
  • elasticsearch-head-master 下载命令
    [root@localhost file]# wget https://github.com/mobz/elasticsearch-head/archive/master.zip
    [root@localhost file]# unzip master.zip
    [root@localhost file]# mv elasticsearch-head-master/ ../
    
  1. 修改配置
  • 添加hostname: ‘*’
[root@localhost elasticsearch-head-master]# vi Gruntfile.js

Elasticsearch-head插件安装_第1张图片

  • 修改app.js的localhost为ip地址
[root@localhost elasticsearch-head-master]# vi _site/app.js

Elasticsearch-head插件安装_第2张图片

  1. head目录下初始化
[root@localhost elasticsearch-head-master]# npm install
  1. 修改ES配置,切换“es账户”,启动ES
[root@localhost elasticsearch-head-master]# cd /usr/local/elasticsearch-7.0.0/conf/
[root@localhost font]# vim elasticsearch.yml    # 文件末尾加上如下配置
	http.cors.enabled: true
	http.cors.allow-origin: "*"
[root@localhost conf]# su es
[es@localhost local]$ cd elasticsearch-7.0.0/
[es@localhost conf]# ./bin/elasticsearch -d
  1. 启动head
[root@localhost elasticsearch-head-master]# grunt server
Running "connect:server" (connect) task
Waiting forever...
Started connect web server on http://localhost:9100

你可能感兴趣的:(Elasticsearch,elasticsearch,head插件)