elasticsearch 安装head

Posted agang-php

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了elasticsearch 安装head相关的知识,希望对你有一定的参考价值。

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

yum install nodejs

npm install

 

修改Elasticsearch配置,允许跨域访问,修改后重新启动Elasticsearch

vi elasticsearch-7.1.1/config/elasticsearch.yml

#添加如下配置,支持跨域访问

http.cors.enabled: true
http.cors.allow-origin: "*"

启动

# elasticsearch-head目录下执行

npm run start

 

 

报错

 ./bin/elasticsearch
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-07-06T17:36:30,052][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [agangdeMacBook-Pro.local] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/docker/elasticsearch-7.1.1/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?

解决

原因:线程占用

解决:重新启动

step1:杀死elasticsearch线程
ps -ef | grep elastic

kill -9 XXX

修改 elasticsearch-head 目录下的 Gruntfile.js 文件,在 options 属性内增加 hostname,设置为 0.0.0.0。

connect: 
    server: 
        options: 
            hostname: ‘0.0.0.0‘,
            port: 9100,
            base: ‘.‘,
            keepalive: true
        
    



以上是关于elasticsearch 安装head的主要内容,如果未能解决你的问题,请参考以下文章

Windows 10 安装ElasticSearch- MSI安装ElasticSearch和安装Kibana

001-windows下Elasticsearch安装Elasticsearch-header安装

elasticsearch 安装

2elasticsearch 的安装和插件的安装

ElasticSearch概述与安装

Elasticsearch 安装