当前位置: 首页 > 面试题库 >

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

颛孙凯定
2023-03-14
问题内容

我知道这个问题已经得到解决,但是我已经尽力了,无法解决我的问题。

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

[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上完全运行并正在侦听。

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

由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的版本对齐):

<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代码:

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)

如果我尝试在终端上执行此命令:

telnet 127.0.0.1 9300

系统提示,我只能输入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

这意味着9300端口是一个很好的端口。

我不明白我在做什么错。

某人可以帮助我吗?

编辑 这是在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)

问题答案:

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

答案是:X-Pack插件。

因此,要检查是否确实是我的麻烦之源,我通过使用以下命令将其删除:
elasticsearch-plugin.bat remove x-pack

而且…现在运作良好。hou!

这是我的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" : {[...]}
            }
        ]
    }
}

我只需要查找此安全令牌部分,但这是另一个主题。

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



 类似资料:
  • 问题内容: 我正在尝试从Java Web Service中的Elastic Search中进行搜索,这是我现在使用的方式: 第一行可以正常工作,但是转到第二行时,将发生以下异常: NoNodeAvailableException [没有已配置的节点可用:[{#transport#-1} {TskPSVeBRR6CvCzP9EVhkQ} {192.168.10.150} {192.168.10.15

  • 我正在尝试从Java Web服务中的弹性搜索进行搜索,下面是我现在的使用方法: 我在Java程序中做了什么(防火墙、库版本、调用API的方法等)错了吗?我现在的Java版本是1.8.0.121,Elastic Search和Transport Client的版本都是5.2。谢了!

  • 问题内容: 我正在上它可为本地 我正在使用Elastic4s进行连接,尝试了以下方法,但是所有这些都给了我错误 和 错误是 我完整的代码是 问题答案: 9200是用于通过HTTP连接的端口,这就是为什么它可以在您的浏览器中工作的原因。如果检查堆栈跟踪的顶部,则可以看到通过传输客户端(即TCP)进行连接,因此需要使用端口9300。试试这个:

  • 问题内容: 过去一个小时刚刚下载并安装了elasticsearch 1.3.2 打开到端口9200和9300:9400的IP表 在/ etc / hosts中设置我的计算机名称和IP 头模块和护理人员已安装且运行平稳 卷曲在本地主机上工作完美 将所有jar从下载中复制到eclipse中,因此版本相同 --Java– -输出- 更新:现在我真的很困惑。我只是按了日食3次。2次收到上述错误。1次搜索成

  • 嗨,朋友们,我正在用开发spring boot项目,我已经在本地机器上安装了弹性搜索,我已经在弹性搜索中安装了插件。我的弹性搜索设置正确,显示绿色标志。项目中的application-dev.yml文件如下: 弹性搜索服务正在我的机器上运行,但当我试图首先保存实体时,我的代码将实体保存在mysql中,然后使用在弹性搜索中,但将实体保存到Elastic中时,它会引发错误: 我也使用了端口而不是,但是

  • 编辑:我直接在我的快速应用程序中对流畅的服务IP进行了编码,并且它的工作。如何在没有 Harcoding IP 的情况下让它工作? 我有几个pod(nodejs express服务器)在Kubernetes集群上运行。 我想将日志从我的nodejs pod发送到Fluentd DeamonSet。 但是我得到了这个错误: 我正在使用 https://github.com/fluent/fluent