美文网首页我爱编程
Elasticsearch远程调用配置

Elasticsearch远程调用配置

作者: 豪大大大 | 来源:发表于2018-05-23 15:18 被阅读0次

    操作过程:

    vim config/elasticsearch.yml,在文件的最后加上 

    network.host: 0.0.0.0 #注意“:”后要有空格和语句前面有空格

    错误提示:

    [2018-05-24T14:35:29,980][INFO ][o.e.n.Node ] [] initializing ...[2018-05-24T14:35:30,009][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/home/es/elasticsearch-6.2.4/data/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])? at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.4.jar:6.2.4] at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.4.jar:6.2.4] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.4.jar:6.2.4]Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/home/es/elasticsearch-6.2.4/data/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])? at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:244) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.node.Node.(Node.java:264) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.node.Node.(Node.java:246) ~[elasticsearch-6.2.4.jar:6.2.4] at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:213) ~[elasticsearch-6.2.4.jar:6.2.4]

            at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[elasticsearch-6.2.4.jar:6.2.4]

            at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]

            at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]

            ... 6 more

    解决:

    增加:transport.host: localhost

    transport.tcp.port: 9300

    http.port: 9200

    总结:

    应该是新版本的更改,完整的语句是增加 

    transport.host: localhost

    transport.tcp.port: 9300

    http.port: 9200

    network.host: 0.0.0.0

    相关文章

      网友评论

        本文标题:Elasticsearch远程调用配置

        本文链接:https://www.haomeiwen.com/subject/ynmrjftx.html