码迷,mamicode.com
首页 > 其他好文 > 详细

elasticsearch 安装head

时间:2019-07-06 19:46:07      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:string   cse   cto   stat   main   org   multi   keepalive   read   

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

标签:string   cse   cto   stat   main   org   multi   keepalive   read   

原文地址:https://www.cnblogs.com/agang-php/p/11143494.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!