elasticsearchを2.3.1から5.xバージョンにアップグレードしました。問題は、複数のelastisearchインスタンス間の同期が行われていないことです。2.3で発生していなかったログ.1バージョン。Elasticsearchがホストの解決に失敗しました
Configuretion:
elk_nodes_ips = []
elk_nodes_results = search(:node, "roles:elasticsearch")
unless elk_nodes_results.empty?
elk_nodes_results.sort!{|node1, node2| node1.name <=> node2.name}
elk_nodes_results.map{ |server|
elk_nodes_ips.push(server['hostname'])}
else
elk_nodes_ips.push('127.0.0.1')
end
data = "[#{elk_nodes_ips.join(",")}]"
elasticsearch_configure 'elasticsearch' do
# if you override one of these, you probably want to override all
path_data node['ElasticsearchWrapper']['path']['data']
path_logs node['ElasticsearchWrapper']['path']['logs']
configuration ({
'network.host' => '0.0.0.0',
'http.port' => 9200,
'discovery.zen.ping.unicast.hosts' => data
})
action :manage
end
例外:
[2017-07-21T06:20:31976] [oedzUnicastZenPing] [ElasticSearch-I-051b2c3eea79d3f62] [WARN]ホストを解決することができませんでした[ [ElasticSearch-i-036a95f01a737f4a2] java.lang.IllegalArgumentException:無効な括弧で囲まれたホスト/ポート範囲:[ElasticSearch-i-036a95f01a737f4a2 at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:871)〜[elasticsearch-5.4。 1.jar:5.4.1] at org.elasticsearch.transport.TcpTransport.addres sesFromString(TcpTransport.java:852)〜[elasticsearch-5.4.1.jar:5.4.1] at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:674)〜[elasticsearch-5.4.1.jar: 5.4.1] 、org.elasticsearch.discovery.zen.UnicastZenPing.lambda $ null $ 0(UnicastZenPing.java:213)〜[elasticsearch-5.4.1.jar:5.4.1] at java.util.concurrent.FutureTask .run(FutureTask.java:266)〜[?:1.8.0_111] 、org.elasticsearch.common.util.concurrent.ThreadContext $ ContextPreservingRunnable.run(ThreadContext.java:569)[elasticsearch-5.4.1.jar: 5.4.1] のjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[?:1.8.0_111] at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[ ?:1.8.0_111] at java.lang.Thread.run(Threa )[?:1.8.0_111] [2017-07-21T06:20:31,984] [警告] [oedzUnicastZenPing] [ElasticSearch-i-051b2c3eea79d3f62]ホストの解決に失敗しました[ElasticSearch-i-051b2c3eea79d3f62] ] java.net.UnknownHostException:ElasticSearch-i-051b2c3eea79d3f62]:名前またはサービスがわからない at java.net.Inet6AddressImpl.lookupAllHostAddr(ネイティブメソッド)〜[?:1.8.0_111] java.net.InetAddress $ 2 lookupAllHostAddr(InetAddress.java:928)〜[?:1.8.0_111] java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)〜[?:1.8.0_111] java.net.InetAddress.getAllByName0 InetAddress.java:1276)〜[?:1.8.0_111] java.net.InetAddress.getAllByName(InetAddress.java:1192)〜[?:1.8.0_111] java.net.InetAddress.getAllByName(InetAddress.java:1276)〜[? java:1126) 〜[?:1.8.0_111] at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:897)〜[elasticsearch-5.4.1.jar:5.4.1] at org.elasticsearch.transport.TcpTransport。 (elasticsearch-5.4.1.jar:アドレス: 5.4.1] 、org.elasticsearch.discovery.zen.UnicastZenPing.lambda $ null $ 0(UnicastZenPing.java:213)〜[elasticsearch-5.4.1.jar:5.4.1] at java.util.concurrent.FutureTask .run(FutureTask.java:266)〜[?:1.8.0_111] 、org.elasticsearch.common.util.concurrent.ThreadContext $ ContextPreservingRunnable.run(ThreadContext.java:569)[elasticsearch-5.4.1.jar: 5.4.1] at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)[?:1.8.0_111] at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[?:1.8.0_111] at java.lang.Thread.run (スレッド:java:745)[?:1.8.0_111] [2017-07-21T06:20:35,010] } {N46xjTXWT8qIQNuRONh8PA} {172.18.50.225} {172.18.50。225:9300}、理由:禅ディスコ選出-ASマスター([0]のノードが参加)
elasticsearch.ymlファイル
cluster.name: elasticsearch
node.name: ElasticSearch-i-012d2c56e9920ec75
path.conf: "/etc/elasticsearch"
path.data: "/vol/data/elasticsearch"
path.logs: "/vol/log/elasticsearch"
network.host: 0.0.0.0
http.port: 9200
discovery.zen.ping.unicast.hosts: "[172.18.51.98]"
ymlファイルを追加しました。 – Deepak
配列をダブルティックではなく、 '[" 172.18.51.98 "]'のように配列内の要素に置きます。そうでない場合は二重引用符で囲まれた要素が使用されますホスト名として – alr