首先说明下我安装时的环境是windows10。

安装步骤

  1. 安装node.js,下载与自己系统符合的版本进行安装:

    官网下载地址:https://nodejs.org/en/download/

  2. 安装完成后可在命令行中输入:node -v查看版本

    clip11board.png

  3. 下载Elasticsearch-Head

    下载地址:https://github.com/mobz/elasticsearch-head

  4. 下载解压后的目录:

    clip22board.png

  5. cmd命令行进入此目录,执行npm install,成功后执行npm run start:

    clipbo33ard.png

  6. 服务开启成功后,在浏览器访问localhost:9100,一开始集群健康值可能会显示:未连接

    clipboa44rd.png

  7. 如果显示未连接,则找到Elasticsearch安装目录(注意,不是Elasticsearch-head安装目录),打开config/elasticsearch.yml,在最下方增加以下代码:

  8. http.cors.enabled: true 
    http.cors.allow-origin: "*" 
    http.cors.allow-methods: OPTIONS, HEAD, GET, POST, PUT, DELETE 
    http.cors.allow-headers: "X-Requested-With, Content-Type, Content-Length, X-User"
  9. 保存后重启Elasticsearch和Elasticsearch-head。

    clip444board.png

  10. end