简体   繁体   English

NoNodeAvailableException [没有配置的节点可用:[{#transport#-1} {...} {127.0.0.1} {127.0.0.1:9300}]]

[英]NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{…}{127.0.0.1}{127.0.0.1:9300}]]

I know that question has already been treated but with all my attemps, no way to fix my issue. 我知道这个问题已经得到了解决,但是我的所有尝试都没有办法解决我的问题。

I just installed elasticsearch and boot it. 我刚刚安装了elasticsearch并启动它。 Here the log of elastic : 这里弹性的日志:

[2017-05-17T00:05:27,290][INFO ][o.e.n.Node               ] [] initializing ...
[2017-05-17T00:05:27,394][INFO ][o.e.e.NodeEnvironment    ] [xhkU1rX] using [1] data paths, mounts [[Data (D:)]], net usable_space [25gb], net total_space [138.4gb], spins? [unknown], types [NTFS]
[2017-05-17T00:05:27,395][INFO ][o.e.e.NodeEnvironment    ] [xhkU1rX] heap size [1.9gb], compressed ordinary object pointers [true]
[2017-05-17T00:05:28,331][INFO ][o.e.n.Node               ] node name [xhkU1rX] derived from node ID [xhkU1rXqQ1OgNhIOdfkifg]; set [node.name] to override
[2017-05-17T00:05:28,332][INFO ][o.e.n.Node               ] version[5.4.0], pid[7944], build[780f8c4/2017-04-28T17:43:27.229Z], OS[Windows 7/6.1/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_101/25.101-b13]
[2017-05-17T00:05:30,421][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [aggs-matrix-stats]
[2017-05-17T00:05:30,422][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [ingest-common]
[2017-05-17T00:05:30,422][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [lang-expression]
[2017-05-17T00:05:30,422][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [lang-groovy]
[2017-05-17T00:05:30,422][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [lang-mustache]
[2017-05-17T00:05:30,422][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [lang-painless]
[2017-05-17T00:05:30,423][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [percolator]
[2017-05-17T00:05:30,423][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [reindex]
[2017-05-17T00:05:30,423][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [transport-netty3]
[2017-05-17T00:05:30,423][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded module [transport-netty4]
[2017-05-17T00:05:30,424][INFO ][o.e.p.PluginsService     ] [xhkU1rX] loaded plugin [x-pack]
[2017-05-17T00:05:34,242][DEBUG][o.e.a.ActionModule       ] Using REST wrapper from plugin org.elasticsearch.xpack.XPackPlugin
[2017-05-17T00:05:34,804][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [controller/11204] [Main.cc@128] controller (64 bit): Version 5.4.0 (Build 120b96fa7f6fa7) Copyright (c) 2017 Elasticsearch BV
[2017-05-17T00:05:34,863][INFO ][o.e.d.DiscoveryModule    ] [xhkU1rX] using discovery type [zen]
[2017-05-17T00:05:36,769][INFO ][o.e.n.Node               ] initialized
[2017-05-17T00:05:36,772][INFO ][o.e.n.Node               ] [xhkU1rX] starting ...
[2017-05-17T00:05:38,384][INFO ][o.e.t.TransportService   ] [xhkU1rX] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}
[2017-05-17T00:05:41,441][INFO ][o.e.c.s.ClusterService   ] [xhkU1rX] new_master {xhkU1rX}{xhkU1rXqQ1OgNhIOdfkifg}{Ki_4aUviS3m6n36CQ73tVw}{127.0.0.1}{127.0.0.1:9300}{ml.enabled=true}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-05-17T00:05:43,372][INFO ][o.e.l.LicenseService     ] [xhkU1rX] license [78f22813-a953-4397-ab90-d9e057e7647e] mode [trial] - valid
[2017-05-17T00:05:43,399][INFO ][o.e.g.GatewayService     ] [xhkU1rX] recovered [28] indices into cluster_state
[2017-05-17T00:05:45,462][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [xhkU1rX] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2017-05-17T00:05:45,474][INFO ][o.e.n.Node               ] [xhkU1rX] started
[2017-05-17T00:05:47,834][INFO ][o.e.c.r.a.AllocationService] [xhkU1rX] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[my-index][3]] ...]).

So, Elastic is fully running and listenning on the port 9300. 因此,Elastic完全运行并在端口9300上进行侦听。

My cluster name is "my-application". 我的群集名称是“my-application”。

Confirmed by elasticsearch.yml : 由elasticsearch.yml确认:

# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: my-application
#

And also confirmed by requesting http://localhost:9200/ : 并通过请求http:// localhost:9200 /来确认

{
  "name" : "xhkU1rX",
  "cluster_name" : "my-application",
  "cluster_uuid" : "ygmbc6k0TpKdJP77OJeG9g",
  "version" : {
    "number" : "5.4.0",
    "build_hash" : "780f8c4",
    "build_date" : "2017-04-28T17:43:27.229Z",
    "build_snapshot" : false,
    "lucene_version" : "6.5.0"
  },
  "tagline" : "You Know, for Search"
}

Here is my Maven dependencies (versions of elastic and client are aligned) : 这是我的Maven依赖项(弹性和客户端的版本是对齐的):

<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>transport</artifactId>
    <version>5.4.0</version>
</dependency>
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-to-slf4j</artifactId>
    <version>2.7</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.21</version>
</dependency>

And here my java piece of code : 在这里我的java代码:

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collections;

import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.transport.client.PreBuiltTransportClient;

public class Test {
    public static void main(String[] args) throws UnknownHostException {
        Settings clusterSettings = Settings.builder()
                .put("cluster.name", "my-application")
                .build();

        TransportClient transportClient = new PreBuiltTransportClient(clusterSettings)
                .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"), 9300));

        try {
            SearchResponse response = transportClient
                    .prepareSearch()
                    .execute().actionGet();
            System.out.println(response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            transportClient.close();
        }
    }
}

that gives me the following logs : 这给了我以下日志:

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{nqelLN69RhSJabcb57_lWQ}{127.0.0.1}{127.0.0.1:9300}]]
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:348)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:246)
    at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)
    at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:366)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)
    at Test.main(Test.java:23)

If I try to execute this command on a terminal : 如果我尝试在终端上执行此命令:

telnet 127.0.0.1 9300

I'm prompted and I can enter only 6 (invisible) characters and elastic console display (I typed azerty) : 我被提示,我只能输入6个(不可见)字符和弹性控制台显示(我输入了azerty):

[2017-05-17T00:30:33,573][WARN ][o.e.x.s.t.n.SecurityNetty4Transport] [xhkU1rX] exception caught on transport layer [[id: 0xda47cab8, L:/127.0.0.1:9300 - R:/127.0.0.1:64226]], closing connection
io.netty.handler.codec.DecoderException: java.io.StreamCorruptedException: invalid internal transport message format, got (61,7a,65,72)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442) ~[netty-codec-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248) ~[netty-codec-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:624) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:524) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:478) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.9.Final.jar:4.1.9.Final]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.io.StreamCorruptedException: invalid internal transport message format, got (61,7a,65,72)
        at org.elasticsearch.transport.TcpTransport.validateMessageHeader(TcpTransport.java:1257) ~[elasticsearch-5.4.0.jar:5.4.0]
        at org.elasticsearch.transport.netty4.Netty4SizeHeaderFrameDecoder.decode(Netty4SizeHeaderFrameDecoder.java:36) ~[?:?]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411) ~[?:?]
        ... 19 more
[2017-05-17T00:30:33,577][WARN ][o.e.x.s.t.n.SecurityNetty4Transport] [xhkU1rX] exception caught on transport layer [[id: 0xda47cab8, L:/127.0.0.1:9300 ! R:/127.0.0.1:64226]], closing connection
io.netty.handler.codec.DecoderException: java.io.StreamCorruptedException: invalid internal transport message format, got (61,7a,65,72)
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442) ~[netty-codec-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:375) ~[netty-codec-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:342) ~[netty-codec-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:325) ~[netty-codec-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:224) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1329) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:231) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:908) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe$7.run(AbstractChannel.java:744) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-common-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) [netty-common-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-transport-4.1.9.Final.jar:4.1.9.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [netty-common-4.1.9.Final.jar:4.1.9.Final]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.io.StreamCorruptedException: invalid internal transport message format, got (61,7a,65,72)
        at org.elasticsearch.transport.TcpTransport.validateMessageHeader(TcpTransport.java:1257) ~[elasticsearch-5.4.0.jar:5.4.0]
        at org.elasticsearch.transport.netty4.Netty4SizeHeaderFrameDecoder.decode(Netty4SizeHeaderFrameDecoder.java:36) ~[?:?]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411) ~[?:?]
        ... 20 more

It means that the port 9300 is the good one. 这意味着9300端口是好的。

I don't understand what I am doing wrong. 我不明白我做错了什么。

Someowe can help me ? Someowe可以帮帮我吗?

EDIT Here is the complete logs after configuring log4j with TRACE on org.elasticsearch : 编辑以下是在org.elasticsearch上使用TRACE配置log4j后的完整日志:

0    [main] TRACE org.elasticsearch.plugins.PluginsService  - plugin loaded from classpath [- Plugin information:
Name: org.elasticsearch.transport.Netty3Plugin
Description: classpath plugin
Version: NA
Native Controller: false
 * Classname: org.elasticsearch.transport.Netty3Plugin]
21   [main] TRACE org.elasticsearch.plugins.PluginsService  - plugin loaded from classpath [- Plugin information:
Name: org.elasticsearch.transport.Netty4Plugin
Description: classpath plugin
Version: NA
Native Controller: false
 * Classname: org.elasticsearch.transport.Netty4Plugin]
24   [main] TRACE org.elasticsearch.plugins.PluginsService  - plugin loaded from classpath [- Plugin information:
Name: org.elasticsearch.index.reindex.ReindexPlugin
Description: classpath plugin
Version: NA
Native Controller: false
 * Classname: org.elasticsearch.index.reindex.ReindexPlugin]
25   [main] TRACE org.elasticsearch.plugins.PluginsService  - plugin loaded from classpath [- Plugin information:
Name: org.elasticsearch.percolator.PercolatorPlugin
Description: classpath plugin
Version: NA
Native Controller: false
 * Classname: org.elasticsearch.percolator.PercolatorPlugin]
28   [main] TRACE org.elasticsearch.plugins.PluginsService  - plugin loaded from classpath [- Plugin information:
Name: org.elasticsearch.script.mustache.MustachePlugin
Description: classpath plugin
Version: NA
Native Controller: false
 * Classname: org.elasticsearch.script.mustache.MustachePlugin]
41   [main] INFO  org.elasticsearch.plugins.PluginsService  - no modules loaded
43   [main] INFO  org.elasticsearch.plugins.PluginsService  - loaded plugin [org.elasticsearch.index.reindex.ReindexPlugin]
43   [main] INFO  org.elasticsearch.plugins.PluginsService  - loaded plugin [org.elasticsearch.percolator.PercolatorPlugin]
43   [main] INFO  org.elasticsearch.plugins.PluginsService  - loaded plugin [org.elasticsearch.script.mustache.MustachePlugin]
43   [main] INFO  org.elasticsearch.plugins.PluginsService  - loaded plugin [org.elasticsearch.transport.Netty3Plugin]
43   [main] INFO  org.elasticsearch.plugins.PluginsService  - loaded plugin [org.elasticsearch.transport.Netty4Plugin]
112  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [force_merge], size [1], queue size [unbounded]
116  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [fetch_shard_started], core [1], max [8], keep alive [5m]
116  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [listener], size [2], queue size [unbounded]
121  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [index], size [4], queue size [200]
122  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [refresh], core [1], max [2], keep alive [5m]
122  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [generic], core [4], max [128], keep alive [30s]
122  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [warmer], core [1], max [2], keep alive [5m]
123  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [search], size [7], queue size [1k]
123  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [flush], core [1], max [2], keep alive [5m]
123  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [fetch_shard_store], core [1], max [8], keep alive [5m]
124  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [management], core [1], max [5], keep alive [5m]
124  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [get], size [4], queue size [1k]
124  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [bulk], size [4], queue size [200]
124  [main] DEBUG org.elasticsearch.threadpool.ThreadPool  - created thread pool: name [snapshot], core [1], max [2], keep alive [5m]
1301 [main] DEBUG org.elasticsearch.common.network.IfConfig  - configuration:

lo
        Software Loopback Interface 1
        inet 127.0.0.1 netmask:255.0.0.0 broadcast:127.255.255.255 scope:host
        inet6 ::1 prefixlen:128 scope:host
        UP MULTICAST LOOPBACK mtu:-1 index:1
[...] other wetwork interfaces [...]

2395 [main] TRACE org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService  - parent circuit breaker with settings [parent,type=PARENT,limit=2622960435/2.4gb,overhead=1.0]
2396 [main] TRACE org.elasticsearch.indices.breaker.request  - creating ChildCircuitBreaker with settings [request,type=MEMORY,limit=2248251801/2gb,overhead=1.0]
2396 [main] TRACE org.elasticsearch.indices.breaker.fielddata  - creating ChildCircuitBreaker with settings [fielddata,type=MEMORY,limit=2248251801/2gb,overhead=1.03]
2396 [main] TRACE org.elasticsearch.indices.breaker.in_flight_requests  - creating ChildCircuitBreaker with settings [in_flight_requests,type=MEMORY,limit=3747086336/3.4gb,overhead=1.0]
2538 [main] DEBUG org.elasticsearch.client.transport.TransportClientNodesService  - node_sampler_interval[5s]
3373 [main] DEBUG org.elasticsearch.client.transport.TransportClientNodesService  - adding address [{#transport#-1}{1hiyV12vSMewRrjSv9ZmmA}{192.168.56.1}{192.168.56.1:9300}]
4016 [main] TRACE org.elasticsearch.indices.breaker.request  - [request] Adjusted breaker by [16440] bytes, now [16440]
4059 [elasticsearch[_client_][transport_client_boss][T#1]] TRACE org.elasticsearch.indices.breaker.request  - [request] Adjusted breaker by [-16440] bytes, now [0]
4059 [elasticsearch[_client_][transport_client_boss][T#1]] TRACE org.elasticsearch.transport.TransportService.tracer  - [1][internal:tcp/handshake] sent to [{#transport#-1}{1hiyV12vSMewRrjSv9ZmmA}{192.168.56.1}{192.168.56.1:9300}] (timeout: [null])
4085 [main] TRACE org.elasticsearch.indices.breaker.request  - [request] Adjusted breaker by [16440] bytes, now [16440]
4087 [elasticsearch[_client_][transport_client_boss][T#1]] TRACE org.elasticsearch.indices.breaker.request  - [request] Adjusted breaker by [-16440] bytes, now [0]
4217 [main] INFO  org.elasticsearch.client.transport.TransportClientNodesService  - failed to get node info for {#transport#-1}{1hiyV12vSMewRrjSv9ZmmA}{192.168.56.1}{192.168.56.1:9300}, disconnecting...
RemoteTransportException[[xhkU1rX][192.168.56.1:9300][cluster:monitor/nodes/liveness]]; nested: ElasticsearchSecurityException[missing authentication token for action [cluster:monitor/nodes/liveness]];
Caused by: ElasticsearchSecurityException[missing authentication token for action [cluster:monitor/nodes/liveness]]
    at org.elasticsearch.xpack.security.support.Exceptions.authenticationError(Exceptions.java:39)
    at org.elasticsearch.xpack.security.authc.DefaultAuthenticationFailureHandler.missingToken(DefaultAuthenticationFailureHandler.java:74)
    at org.elasticsearch.xpack.security.authc.AuthenticationService$AuditableTransportRequest.anonymousAccessDenied(AuthenticationService.java:506)
    at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.lambda$handleNullToken$14(AuthenticationService.java:331)
    at org.elasticsearch.xpack.security.authc.AuthenticationService$Authenticator.handleNullToken(AuthenticationService.java:336)
    [...] some additionnal stacktrace [...]
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(Thread.java:745)
NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{1hiyV12vSMewRrjSv9ZmmA}{192.168.56.1}{192.168.56.1:9300}]]
    at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:348)
    at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:246)
    at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)
    at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:366)
    at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
    at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)
    at Test.main(Test.java:22)

I have encountered same problem and i solved the mentioned issue by adding transport.host: localhost property in elasticsearch.yml file. 我遇到了同样的问题,我通过在elasticsearch.yml文件中添加transport.host: localhost属性解决了上述问题。

After adding it, it works as expected. 添加后,它按预期工作。 I hope it will help other reader of this thread. 我希望它能帮助这个主题的其他读者。

OK, by providing you the logs in the EDIT part of my question, I saw a security exception. 好的,通过在我的问题的EDIT部分提供日志,我看到了一个安全异常。 So I asked to myself : which part of ES is providing the security aspect. 所以我问自己:ES的哪个部分提供了安全方面。

The answer is : X-Pack plugin. 答案是:X-Pack插件。

So to check if it's realy the source of my troubles, I removed it by using this command : 因此,为了检查它是否真的是我的麻烦的来源,我使用此命令删除它:
elasticsearch-plugin.bat remove x-pack

And... it's working well now. 而且......它现在运作良好。 Youhou ! 有厚!

Here is the result of my piece of Java code : 这是我的Java代码的结果:

{
    "took" : 21,
    "timed_out" : false,
    "_shards" : {
        "total" : 44,
        "successful" : 44,
        "failed" : 0
    },
    "hits" : {
        "total" : 306673,
        "max_score" : 1.0,
        "hits" : [{
                "_index" : ".kibana",
                "_type" : "config",
                "_id" : "5.0.0",
                "_score" : 1.0,
                "_source" : {
                    "buildNum" : 14438
                }
            },
            {
                "_index" : ".monitoring-alerts-2",
                "_type" : "doc",
                "_id" : "ygmbc6k0TpKdJP77OJeG9g_elasticsearch_cluster_status",
                "_score" : 1.0,
                "_source" : {[...]}
            },
            {
                "_index" : ".monitoring-data-2",
                "_type" : "kibana",
                "_id" : "60fef358-886c-43cb-9ef1-2257ccd2bcbb",
                "_score" : 1.0,
                "_source" : {[...]}
            },
            {[...]},
            {
                "_index" : ".monitoring-es-2-2017.05.11",
                "_type" : "index_stats",
                "_id" : "AVv3uOacGOX_5IPHNH_2",
                "_score" : 1.0,
                "_source" : {[...]}
            }
        ]
    }
}

I just have to look for this security token part but it's another topic. 我只需要查找此安全令牌部分,但这是另一个主题。

Many thanks to @andrei-stefan for the helping comment ;) 非常感谢@ andrei-stefan的帮助评论;)

I had exactly this issue, and for me it was the version between elasticsearch running on my host and the elasticsearch version in my IntelliJ pom.xml 我确实遇到了这个问题,对我来说,这是我的主机上运行的elasticsearch和IntelliJ pom.xml中的elasticsearch版本之间的版本

When I used the same version on both ends it worked. 当我在两端使用相同的版本时,它工作。 Ie I downloaded the same version for my host as my client and then it worked. 即我为我的主机下载了与我的客户相同的版本然后它工作。

I modified this working sample to figure it out: 我修改了这个工作样本来弄清楚:

https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-elasticsearch https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-elasticsearch

I had the same issue. 我遇到过同样的问题。 My problem was that the cluster name in my /etc/elasticsearch.yml file was different from the cluster name I was referencing in my application. 我的问题是我的/etc/elasticsearch.yml文件中的群集名称与我在应用程序中引用的群集名称不同。

I made the names match and bingo! 我把名字匹配和宾果游戏!

if you are running the elastic search via docker image. 如果您通过docker image运行弹性搜索。 then runt the docker image via below command. 然后通过下面的命令runt docker镜像。

docker run -p 9400:9200 -p 9401:9300 -e "http.host=0.0.0.0" -e "transport.host=0.0.0.0" -e "xpack.security.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:5.2.2

-e "transport.host=127.0.0.1" did not work. -e“transport.host = 127.0.0.1”无法正常工作。

Also settings should be as below. 设置也应如下所示。 donot add the .put("client.transport.sniff", true). 不要添加.put(“client.transport.sniff”,true)。

Settings esSettings = Settings.builder()
            .put("cluster.name", EsClusterName)
            .build();

Here goes a very simple example: https://github.com/EdersonJunior/ElasticSearch_Java 这是一个非常简单的例子: https//github.com/EdersonJunior/ElasticSearch_Java

My elasticsearch.yml file is like that: 我的elasticsearch.yml文件是这样的:

cluster.name: "elasticsearch"
node.name: "myNode"
network.host: 0.0.0.0
http.port: 9200

It's very important you setup the 9300 host port at properties file. 在属性文件中设置9300主机端口非常重要。

Use ElasticSearch 6.3.1 and Springboot2.0.0.RELASE and do the following changes: 使用ElasticSearch 6.3.1和Springboot2.0.0.RELASE并执行以下更改:

  1. Use the following code to connect the your local ElasticSearch Server: 使用以下代码连接本地ElasticSearch服务器:

Settings settings = Settings.builder().put("cluster.name", "farkalit-cluster").build(); 设置设置= Settings.builder()。put(“cluster.name”,“farkalit-cluster”)。build(); transportClient = new PreBuiltTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300)); transportClient = new PreBuiltTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName(“localhost”),9300));

  1. Update the ESeach..\\config\\elasticsearch.yml cluster.name: farkalit-cluster 更新ESeach .. \\ config \\ elasticsearch.yml cluster.name:farkalit-cluster

It will solves the problem. 它将解决问题。

Just for reference, I am using 7.2 while I was trying to use 仅供参考,我正在尝试使用7.2

org.elasticsearch.client:transport:5.5.1

and following code to connect to my local cluster, and same error popped into my face. 并按照代码连接到我的本地群集,同样的错误弹出我的脸。

public static void main(String... args) {
        TransportClient client = getClient();
        SearchResponse response = client.prepareSearch("cars").execute().actionGet();
        System.out.println(response);
    }

    private static TransportClient getClient() {
        TransportClient client = null;
        try {
            client = new PreBuiltTransportClient(
                    Settings.builder().put("client.transport.sniff", true)
                            .put("cluster.name", "elasticsearch").build())
                    .addTransportAddress(new TransportAddress(InetAddress.getByName("127.0.0.1"), 9300));
            client.listedNodes();
        } catch (UnknownHostException e) {

        }
        return client;
    }

As I checked the ES console, it's already warned me of the version issues 当我检查ES控制台时,它已经警告我版本问题了

exception caught on transport layer [Netty4TcpChannel{localAddress=/127.0.0.1:9300, remoteAddress=/127.0.0.1:62723}], closing connection
java.lang.IllegalStateException: Received handshake message from unsupported version: [5.0.0] minimal compatible version is: [6.8.0]

So I just use the new version to fix the error. 所以我只是使用新版本来修复错误。

org.elasticsearch.client:transport:7.2.0

This error may come because of the version mismatch. 由于版本不匹配,可能会出现此错误。 Check in elastic search logs, it will specify more details about the minimum version of elasticsearch client to be used. 检入弹性搜索日志,它将指定有关要使用的elasticsearch客户端的最低版本的更多详细信息。 So either upgrade client jar or run below versions of elasticsearch 因此,要么升级客户端jar,要么运行以下版本的elasticsearch

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NoNodeAvailableException[没有配置的节点可用:[{#transport#-1}{OqtopIzTQmOjjLBzr2G_JA}{127.0.0.1}{127.0.0.1:9300}]] - NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{OqtopIzTQmOjjLBzr2G_JA}{127.0.0.1}{127.0.0.1:9300}]] NoNodeAvailableException[没有配置的节点可用:[{#transport#-1}{XY6cYmf7Sn-DRZgzeq3PBA}{localhost}{127.0.0.1:9300}]] - NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{XY6cYmf7Sn-DRZgzeq3PBA}{localhost}{127.0.0.1:9300}]] org.elasticsearch.client.transport.NoNodeAvailableException:没有配置的节点可用:[] - org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [] NoNodeAvailableException : 没有配置的节点可用 - NoNodeAvailableException : None of the configured nodes are available Elasticsearch NoNodeAvailableException没有配置的节点可用 - Elasticsearch NoNodeAvailableException None of the configured nodes are available NoNodeAvailableException [没有已配置的节点可用]在Elasticsearch 5.1.2中 - NoNodeAvailableException[None of the configured nodes are available] in Elasticsearch 5.1.2 无法在TransportClient中创建InetSocketTransportAddress:NoNodeAvailableException [没有配置的节点 - 可用:[]] - Can't create InetSocketTransportAddress in TransportClient: NoNodeAvailableException[None of the configured nodes -are available: []] 获取org.elasticsearch.transport.NodeDisconnectedException:[] [inet [localhost / 127.0.0.1:9300]] [集群/节点/信息]已断开连接 - Getting org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/127.0.0.1:9300]][cluster/nodes/info] disconnected Java ElasticSearch 没有配置的节点可用 - Java ElasticSearch None of the configured nodes are available 无法连接到Elasticsearch 6.1.0 [没有已配置的节点可用] - Unable to Connect to Elasticsearch 6.1.0[None of the configured nodes are available]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM