私の環境は2つの物理マシンで、どちらもドッカー作成で動作しています。docker-composeを使ってelasticsearchクラスタを設定しようとしています
私はelasticsearchクラスタクロス2ドッカーのコンテナを作成したいと思います。
2の容器は、互いに任意のアイデアを接続することはできませんか? 5.4.2
ドッカー-compose.yml
version: '2'
services:
elasticsearch:
image: es:542
hostname: es2
container_name: es2
user: elasticsearch
ports:
- 9200:9200
- 9300:9300
environment:
- ES_JAVA_OPTS=-Xms1g -Xmx1g
command: /usr/share/elasticsearch/bin/elasticsearch
elasticsearch.yml
http.host: 0.0.0.0
transport.host: 0.0.0.0
discovery.zen.minimum_master_nodes: 2
cluster.name: prod_es_cluster
node.name: prod_es_node1
node.master: true
node.data: true
discovery.zen.ping_timeout: 10s
network.host: 0.0.0.0
network.bind_host: 0.0.0.0
network.publish_host: 0.0.0.0
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["127.0.0.1", "[::1]"]
とログ
ES1
[2017:
ドッカー画像がelasticsearchを使用しています-11-09T05:56:10,55 2] [INFO] [oetTransportService] [prod_es_node1] publish_address {172.24.0.2:9300}, bound_addresses {[::]:9300}
[2017-11-09T05:56:10,558] [oebBootstrapChecks] [prod_es_node1]非ループバックまたは非リンクローカルへのバインドまたはパブリッシングアドレス、ブートストラップチェックを実施する [2017-11-09T05:56:40,576] [警告] [oenNode] [prod_es_node1] timed out while waiting for initial discovery state - timeout: 30s
[2017-11-09T05:56:40,584] [情報] [oehnNetty4HttpServerTransport] [prod_es_node1] publish_address {172.24.0.2:9200}, bound_addresses {[::]:9200}
[2017-11-09T05は:56:40587]は[情報] [oenNode] [prod_es_node1]開始
ES2
[2017-11-09T09:37:20084] [WARN] [oedzZenDiscovery] [prod_es_node2]がマスターに接続できませんでした[{prod_es _node1} {BxKzhOnJTUC50cYTz_Hm fAと} {zqtU07jfQJOrmB9AYL01Ig} {172.24.0.2}{172.24.0.2:9300}], retrying...
org.elasticsearch.transport.ConnectTransportException:[prod_es_node1] org.elasticsearch.transport.netty4.Netty4Transport.connectToChannels(Netty4Transport.java:361)で[172.24.0.2:9300] connect_timeout[30s]
〜[:?] org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:549)〜[elasticsearch-5.4.2.jar:5.4.2] at org.elasticsearch.transport.TcpTransport.connectToNode(TcpTransport.java:473)〜 [elasticsearch-5.4.2.jar:5.4.2] at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:315)〜[elasticsearch-5.4.2.jar:5.4.2] at org.elasticsearch .transport.TransportService.connectToNode(TransportService.java:302)〜[elasticsearch-5.4.2.jar:5.4.2] またはg.elasticsearch.discovery.zen.ZenDiscovery.joinElectedMaster(ZenDiscovery.java:468)[elasticsearch-5.4.2.jar:5.4.2] at org.elasticsearch.discovery.zen.ZenDiscovery.innerJoinCluster(ZenDiscovery.java:420) )[elasticsearch-5.4.2.jar:5.4.2] 、org.elasticsearch.discovery.zen.ZenDiscovery.access $ 4100(ZenDiscovery.java:83)[elasticsearch-5.4.2.jar:5.4.2] at org.elasticsearch.discovery.zen.ZenDiscovery $ JoinThreadControl $ 1.run(ZenDiscovery.java:1197)[elasticsearch-5.4.2.jar:5.4.2] at org.elasticsearch.common.util.concurrent.ThreadContext $ ContextPreservingRunnable。 run(ThreadContext.java:569)[elasticsearch-5.4.2。 jar:5.4.2] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)の [?:1.8.0_131] のjava.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java: 617)[?:1.8.0_131] java.lang.Thread.run(Thread.java:748)[?:1.8.0_131] 原因:io.netty.channel。AbstractChannel $ AnnotatedConnectException:sun.nio.ch.SocketChannelImpl.checkConnect(ネイティブメソッド)でConnection refused: 172.24.0.2/172.24.0.2:9300
〜[:??]