elasticsearch,Java,elasticsearch" /> elasticsearch,Java,elasticsearch" />

Java NoNodeAvailableException[所有配置的节点都不可用]Elasticsearch

Java NoNodeAvailableException[所有配置的节点都不可用]Elasticsearch,java,elasticsearch,Java,elasticsearch,我已经尝试了在互联网上发布的所有可用解决方案,但这些都没有解决我面临的错误。我已经创建了单节点主服务器和数据服务器,我的集群配置如下: Elasticsearch.yml # ======================== Elasticsearch Configuration ========================= # # NOTE: Elasticsearch comes with reasonable defaults for most settings. # B

我已经尝试了在互联网上发布的所有可用解决方案,但这些都没有解决我面临的错误。我已经创建了单节点主服务器和数据服务器,我的集群配置如下:

Elasticsearch.yml

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html>
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
 cluster.name: ers-reseller-data
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
 node.name: node-1
#
# Add custom attributes to the node:

 node.master: true
# node.client: true
 node.data: true

# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
# path.data: /opt/seamless/etc/dist/core/database/elasticsearch
#
# Path to log files:
#
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
 bootstrap.memory_lock: true
 bootstrap.system_call_filter: false
#
# Make sure that the `ES_HEAP_SIZE` environment variable is set to about half the memory
# available on the system and that the owner of the process is allowed to use this limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
 network.host: 0.0.0.0
 cluster.initial_master_nodes: node-1
#
# Set a custom port for HTTP:
#
 http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["node-1", "node-2", "node-3"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
 node.max_local_storage_nodes: 2
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true
#node.local: true
# discovery.zen.ping.multicast.enabled: false
# discovery.zen.ping.unicast.hosts: ["node-1"]
执行
curl'http://localhost:9200/_nodes“
它还显示了可用节点的详细信息。但是当我试图用
Java
code连接execute时,它显示了以下异常

例外情况:

java.lang.Exception: NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{Ntvnz9ljSha0lZ7-2d3VGQ}{localhost}{127.0.0.1:9200}]]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
    at se.seamless.mcs.profilingsystem.services.impl.ElasticSearchSalesDataService.findCreditScoreMetrics(ElasticSearchSalesDataService:79)
    at se.seamless.mcs.profilingsystem.services.SalesDataService$findCreditScoreMetrics.call(Unknown Source)
    at o

请告诉我我遗漏了什么或做错了什么,以及为什么它没有抛出可用的节点异常。谢谢

你能分享你的java初始化客户端代码吗?你在客户端缺少集群名称吗?@Nirmal我在那里也提到了集群名称
java.lang.Exception: NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{Ntvnz9ljSha0lZ7-2d3VGQ}{localhost}{127.0.0.1:9200}]]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
    at se.seamless.mcs.profilingsystem.services.impl.ElasticSearchSalesDataService.findCreditScoreMetrics(ElasticSearchSalesDataService:79)
    at se.seamless.mcs.profilingsystem.services.SalesDataService$findCreditScoreMetrics.call(Unknown Source)
    at o