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}]]

查看:217
本文介绍了NoNodeAvailableException [没有已配置的节点可用:[{#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.

我刚刚安装了elasticsearch并启动了它。这里是弹性的日志:

I just installed elasticsearch and boot it. 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]] ...]).

因此,Elastic已完全运行并在端口9300上监听。

So, Elastic is fully running and listenning on the port 9300.

我的集群名称是我的应用程序。

My cluster name is "my-application".

由elasticsearch.yml确认:

Confirmed by elasticsearch.yml :

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

并通过请求 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"
}

这是我的Maven依赖项(elastic和client的版本对齐):

Here is my Maven dependencies (versions of elastic and client are aligned) :

<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>

这是我的Java代码:

And here my java piece of code :

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();
        }
    }
}

这给了我以下日志:

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

系统会提示我,我只能输入6个(不可见的)字符和弹性控制台显示(我键入azerty):

I'm prompted and I can enter only 6 (invisible) characters and elastic console display (I typed 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

9300端口是他是个好人。

It means that the port 9300 is the good one.

我不明白我在做什么错。

I don't understand what I am doing wrong.

有人可以帮助我吗?

编辑
这是在org.elasticsearch上用TRACE配置log4j之后的完整日志:

EDIT Here is the complete logs after configuring log4j with TRACE on org.elasticsearch :

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)


推荐答案

确定,通过在问题的EDIT部分中为您提供日志,我看到了一个安全异常。
所以我问自己:ES的哪一部分提供了安全性。

OK, by providing you the logs in the EDIT part of my question, I saw a security exception. So I asked to myself : which part of ES is providing the security aspect.

答案是:X-Pack插件。

The answer is : X-Pack plugin.

因此,要检查它是否确实是我的麻烦的根源,我使用以下命令将其删除:

elasticsearch-plugin.bat remove 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

而且...现在运行良好。 Youhou!

And... it's working well now. Youhou !

这是我的Java代码的结果:

Here is the result of my piece of Java code :

{
    "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.

非常感谢@ andrei-stefan为帮助评论;)

Many thanks to @andrei-stefan for the helping comment ;)

这篇关于NoNodeAvailableException [没有已配置的节点可用:[{#transport#-1} {...} {127.0.0.1} {127.0.0.1:9300}]]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆