Cluster config not working

Hi,

Trying to setup two ES clusters: "cluster1" & "cluster2" (each cluster has one node), but both dockers crash after few seconds

The first cluster:

docker-compose.yml:

version: '3.3'

services:

  elasticsearch1:
    hostname: elasticsearch1
    build:
      context: elasticsearch/
      args:
        ELK_VERSION: 6.7.0
    volumes:
      - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    ports:
      - "9201:9200"
      - "9301:9300"
    environment:
      - "ES_JAVA_OPTS=-Xmx500m -Xms500m"
    networks:
      - kibana-es


  kibana1:
    hostname: kibana1
    build:
      context: kibana/
      args:
          ELK_VERSION: 6.7.0
    volumes:
      - ./kibana/config/:/usr/share/kibana/config:ro
    ports:
      - "5601:5601"
    networks:
      - kibana-es

networks:
  kibana-es:
    driver: bridge

elasticsearch1.yml:

cluster.name: "cluster1"
network.host: 0.0.0.0

cluster:
  remote:
    cluster2:
      seeds: 192.168.56.1:9302
      skip_unavailable: false

The second cluster

docker-compose.yml:

version: '3.3'

services:


  elasticsearch2:
    hostname: elasticsearch2
    build:
      context: elasticsearch/
      args:
        ELK_VERSION: 6.7.0
    volumes:
      - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    ports:
      - "9202:9200"
      - "9302:9300"
    environment:
      - "ES_JAVA_OPTS=-Xmx500m -Xms500m"
    networks:
      - kibana-es2


  kibana2:
    hostname: kibana2
    build:
      context: kibana/
      args:
          ELK_VERSION: 6.7.0
    volumes:
      - ./kibana/config/:/usr/share/kibana/config:ro
    ports:
      - "5602:5601"
    networks:
      - kibana-es2

networks:
  kibana-es2:
    driver: bridge

elasticsearch2.yml:

cluster.name: "cluster2"
network.host: 0.0.0.0

cluster:
  remote:
    cluster1:
      seeds: 192.168.56.1:9301
      skip_unavailable: false

The log output for elasticsearch1

[2019-04-07T20:54:21,301][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [kOhAJUR] [controller/87] [Main.cc@109] controller (64 bit): Version 6.7.0 (Build d74ae2ac01b10d) Copyright (c) 2019 Elasticsearch BV
[2019-04-07T20:54:22,509][INFO ][o.e.d.DiscoveryModule    ] [kOhAJUR] using discovery type [zen] and host providers [settings]
[2019-04-07T20:54:23,939][INFO ][o.e.n.Node               ] [kOhAJUR] initialized
[2019-04-07T20:54:23,940][INFO ][o.e.n.Node               ] [kOhAJUR] starting ...
[2019-04-07T20:54:24,167][INFO ][o.e.t.TransportService   ] [kOhAJUR] publish_address {172.24.0.3:9300}, bound_addresses {0.0.0.0:9300}
[2019-04-07T20:54:24,305][WARN ][o.e.t.RemoteClusterConnection] [kOhAJUR] fetching nodes from external cluster [apache2] failed
org.elasticsearch.transport.ConnectTransportException: [][192.168.56.1:9202] general node connection failure
        at org.elasticsearch.transport.TcpTransport$ChannelsConnectedListener$1.onFailure(TcpTransport.java:1294) ~[elasticsearch-6.7.0.jar:6.7.0]   

The connectivity is allowed between the two nodes.

Any idea if the problem is the configuration of my two clusters?

Hi @haux,

there are two immediate things that stand out:

fetching nodes from external cluster [apache2] failed

and

[192.168.56.1:9202]

apache2 is not the one defined in the .yml file. And the port in use is 9202, should probably have been 9302.

A guess is that this definition is stored in the cluster settings on cluster1, see: Remote clusters | Elasticsearch Guide [8.11] | Elastic for more info.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.