elasticsearch 如何在elasticsearch 2.3.3中创建两个节点的群集?,elasticsearch,configuration,elasticsearch,Configuration" /> elasticsearch 如何在elasticsearch 2.3.3中创建两个节点的群集?,elasticsearch,configuration,elasticsearch,Configuration" />

elasticsearch 如何在elasticsearch 2.3.3中创建两个节点的群集?

elasticsearch 如何在elasticsearch 2.3.3中创建两个节点的群集?,elasticsearch,configuration,elasticsearch,Configuration,我一直在尝试创建一个新的Elasticsearch集群,其中包含两个节点,每个节点位于不同的服务器上,具有不同的IP(让我们分别称它们为x.x.x.x和x.x.x.y)。但是,我很难找到可以帮助节点找到彼此并连接的配置。我应该将什么设置为各自的绑定和发布主机?在我的日志文件中,我得到了这个错误,我猜这与此有关: [2016-06-21 13:17:00,118][WARN ][transport.netty ] [node2] exception caught on trans

我一直在尝试创建一个新的Elasticsearch集群,其中包含两个节点,每个节点位于不同的服务器上,具有不同的IP(让我们分别称它们为x.x.x.x和x.x.x.y)。但是,我很难找到可以帮助节点找到彼此并连接的配置。我应该将什么设置为各自的绑定和发布主机?在我的日志文件中,我得到了这个错误,我猜这与此有关:

[2016-06-21 13:17:00,118][WARN ][transport.netty          ] [node2] exception caught on transport layer [[id: 0x8ae6b31f]], closing connection
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.jboss.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
    at org.jboss.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
    at org.jboss.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
    at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
    at org.jboss.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
    at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
如果有帮助,以下是每个节点的elasticsearch.yml文件:

对于节点x.x.x.x

# ======================== 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: name
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node1
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
# path.data: /path/to/data
#
# Path to log files:
#
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.mlockall: true
#
# 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.bind_host: 127.0.0.1
network.publish_host: x.x.x.x
# tcp.port: 9300
#
#
# 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.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["x.x.x.x", "x.x.x.y"]
#
# 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: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true
#==================================弹性搜索配置=====================
#
#注意:Elasticsearch为大多数设置提供了合理的默认值。
#在开始调整和调整配置之前,请确保
#了解你想要实现的目标及其后果。
#
#配置节点的主要方法是通过此文件。此模板列出
#您可能希望为生产群集配置的最重要的设置。
#
#有关配置选项的更多信息,请参阅文档:
# 
#
#------------------------------------集群-----------------------------------
#
#为群集使用描述性名称:
#
cluster.name:name
#
#-------------------------------------节点------------------------------------
#
#为节点使用描述性名称:
#
node.name:node1
node.master:true
node.data:true
#
#将自定义属性添加到节点:
#
#node.rack:r1
#
#------------------------------------路径------------------------------------
#
#存储数据的目录路径(用逗号分隔多个位置):
#
#path.data:/path/to/data
#
#日志文件的路径:
#
#path.logs:/path/to/logs
#
#-------------------------------------内存-----------------------------------
#
#启动时锁定内存:
#
bootstrap.mlockall:真
#
#确保'ES_HEAP_SIZE'环境变量设置为内存的一半左右
#在系统上可用,并且允许进程所有者使用此限制。
#
#当系统交换内存时,Elasticsearch性能不佳。
#
#------------------------------------网络-----------------------------------
#
#将绑定地址设置为特定IP(IPv4或IPv6):
#
network.bind_主机:127.0.0.1
network.publish_主机:x.x.x.x
#tcp.port:9300
#
#
#为HTTP设置自定义端口:
#
#http.port:9200
#
#有关更多信息,请参阅以下位置的文档:
# 
#
#-------------------------------------发现----------------------------------
#
#在启动新节点时传递要执行查找的主机的初始列表:
#主机的默认列表为[“127.0.0.1”、“[::1]”
#
discovery.zen.ping.multicast.enabled:false
discovery.zen.ping.unicast.hosts:[“x.x.x.x”、“x.x.x.y”]
#
#通过配置大多数节点(节点总数/2+1)防止“大脑分裂”:
#
#discovery.zen.minimum_主节点:3
#
#有关更多信息,请参阅以下位置的文档:
# 
#
#------------------------------------网关-----------------------------------
#
#在完全重新启动群集后阻止初始恢复,直到启动N个节点:
#
#gateway.recover_在_节点之后:3
#
#有关更多信息,请参阅以下位置的文档:
# 
#
#------------------------------各种-----------------------------------
#
#禁用在单个系统上启动多个节点:
#
#node.max\u本地存储\u节点:1
#
#删除索引时需要显式名称:
#
#action.destructive_需要_名称:true
对于x.x.x.y:

# ======================== 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: name
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node2
node.master: false
node.data: true
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
# path.data: /path/to/data
#
# Path to log files:
#
# path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.mlockall: true
#
# 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.bind_host: 127.0.0.1
network.publish_host: x.x.x.x
#
# 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.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["x.x.x.x", "x.x.x.y"]
#
# 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: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true
#==================================弹性搜索配置=========================
#
#注意:Elasticsearch为大多数设置提供了合理的默认值。
#在开始调整和调整配置之前,请确保
#了解你想要实现的目标及其后果。
#
#配置节点的主要方法是通过此文件。此模板列出
#您可能希望为生产群集配置的最重要的设置。
#
#有关配置选项的更多信息,请参阅文档:
# 
#
#------------------------------------集群-----------------------------------
#
#为群集使用描述性名称:
#
cluster.name:name
#
#-------------------------------------节点------------------------------------
#
#为节点使用描述性名称:
#
node.name:node2
node.master:false
node.data:true
#
#将自定义属性添加到节点:
#
#node.rack:r1
#
#------------------------------------路径------------------------------------
#
#存储数据的目录路径(用逗号分隔多个位置):
#
#path.data:/path/to/data
#
#日志文件的路径:
#
#path.logs:/path/to/logs
#
#-------------------------------------内存-----------------------------------
#
#启动时锁定内存:
#
bootstrap.mlockall:真
#
#确保'ES_HEAP_SIZE'环境变量设置为内存的一半左右
#在系统上可用,并且允许进程所有者使用此限制。
#
#当系统交换内存时,Elasticsearch性能不佳。
#
#------------------------------------网络-----------------------------------
#
#将绑定地址设置为特定IP(IPv4或IPv6):
#
network.bind_主机:127.0.0.1
network.publish_主机:x.x.x.x
#
#为HTTP设置自定义端口:
#
#http.port:9200
#
#有关更多信息,请参阅以下位置的文档:
# 
#
#-------------------------------------发现----------------------------------
#
#在启动新节点时传递要执行查找的主机的初始列表:
#主机的默认列表为[“127.0.0.1”、“[::1]”
#
discovery.zen.ping.multicast.enabled:false
discovery.zen.ping.unicast.hosts:[“x.x.x.x”、“x.x.x.y”]
#
#通过配置大多数节点(节点总数/2+1)防止“大脑分裂”:
#
#discovery.zen.minimum_主节点:3
#
#有关更多信息,请参阅文档