2016-06-21 6 views
1

私は2つのノードを持つ新しいElasticsearchクラスタを作成しようとしていました。各ノードはそれぞれ異なるサーバー上にあり、異なるIPを持っています(x.x.x.xとx.x.x.yと呼ばせてください)。しかし、私は、ノードがお互いを見つけて接続するのに役立つ構成を考え出すのに問題があります。自分のバインドと公開のホストとして設定する必要があるのは何ですか?それが助け場合は、以下、elasticsearch 2.3.3で2つのノードのクラスタを作成するにはどうすればよいですか?

[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ファイルです:私のログファイルでは、私は推測しているこのエラーは、それに関係している得る

ノードXXXXについて

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

とXXXY用:

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

ありがとう!

答えて

0

elasticsearchクラスタを作成するには、同じクラスタ名を持つ同じサブネット上に2つのelasticsearchインスタンスを作成する必要があります。それでおしまい。 http://x.x.x.x:9200/_cat/nodes?vのリンクを確認して、どのノードがクラスタに接続されているかを確認してください。あなたの問題は、クラスタに接続しようとしているアプリケーション側の問題だと思います。

+0

x.x.x.xには1つのノードしか接続されておらず、それ自体です。私がxxxyに行き、http:// xxxx:9200/_nodes/_all/print?をきれいにすると、エラーが発生し、http:// xxxy:9200/_nodes/_all/print?pretty、 1つのノードを参照してください。彼らはどちらもシングルノードクラスタを作成していて、何らかの理由で接続していないようです。 – arda

+0

@ardaあなたは正しいと思います。なぜあなたは、デフォルトの弾性設定の答えで示唆されているものと同じものを試してみませんか? – bornConfused

+0

解決済み - ファイアウォールがポートをブロックし、サーバーの接続を妨げていました。設定ファイルの問題ではありません。 – arda

関連する問題