# Single node Cross Cluster Search

**URL:** <https://discuss.elastic.co/t/single-node-cross-cluster-search/141574>\
**Category:** Elasticsearch\
**Created:** [July 25, 2018, 1:02pm UTC](https://discuss.elastic.co/t/single-node-cross-cluster-search/141574 "2018-07-25T13:02:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hari\_Prasad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hari_prasad/32/56784_2.png) [@Hari\_Prasad](https://discuss.elastic.co/u/Hari_Prasad)\
**Post date:** [July 25, 2018, 1:02pm UTC](https://discuss.elastic.co/t/single-node-cross-cluster-search/141574/1 "2018-07-25T13:02:41Z")

</div>

We are testing out The Elasticsearch cross cluster search

Our Setup is 2 ELK+Kafka cluster in docker with each having single nodes of all component, that is Elasticsearch, Logstatsh, Kibana and Kafka.

Below is the Docker-compose for setup one:

version: '2'

```
services:

  elasticsearch:
    build:
      context: elasticsearch/
    volumes:
      - "./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro"
      - "./esdata:/usr/share/elasticsearch/data"
    ports:
      - "16022:16022"
      - "16021:16021"
    environment:
      ES_JAVA_OPTS: "-Xmx256m -Xms256m"
      discovery.type: zen
      discovery.zen.ping.unicast.hosts: elasticsearch
    networks:
      - elk
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536

  logstash:
    build:
      context: logstash/
    volumes:
      - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro
      - ./logstash/pipeline:/usr/share/logstash/pipeline:ro
    ports:
      - "5000:5000"
    environment:
      LS_JAVA_OPTS: "-Xmx256m -Xms256m"
    networks:
      - elk
    depends_on:
      - elasticsearch

  kibana:
    build:
      context: kibana/
    volumes:
      - ./kibana/config/:/usr/share/kibana/config:ro
    ports:
      - "5601:5601"
    networks:
      - elk
    depends_on:
      - elasticsearch

  zookeeper:
    image: confluentinc/cp-zookeeper:latest
    networks:
      - elk
    environment:
      ZOOKEEPER_CLIENT_PORT: 32181
      ZOOKEEPER_TICK_TIME: 2000
    extra_hosts:
      - "default:127.0.0.1"
  kafka:
    image: confluentinc/cp-kafka:latest
    networks:
      - elk
    depends_on:
      - zookeeper
    ports:
      - "16020:16020"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181
      KAFKA_ADVERTISED_LISTENERS: EXT://<setup_1_ip>:16020, INT://kafka:9092
      KAFKA_INTER_BROKER_LISTENER_NAME: INT
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INT:PLAINTEXT, EXT:PLAINTEXT
    extra_hosts:
      - "default:127.0.0.1"

networks:
  elk:
    driver: bridge

```

The Elasticsearch yml file is as below

```
---
# Default Elasticsearch configuration from elasticsearch-docker.
#
cluster.name: "docker-cluster_setup_1"
network.host: 0.0.0.0
network.publish_host: <setup_1_ip>

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
#discovery.zen.minimum_master_nodes: 1

# Use single node discovery in order to disable production mode and avoid bootstrap checks
# see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
#
discovery.type: zen

# Set a custom port for the node to node communication (9300 by default):
#
transport.tcp.port: 16022
# Set a custom port to listen for HTTP traffic:
#
http.port: 16021
search:
    remote:
        cluster_setup2: 
            seeds: <setup_2_ip>:16022

```

The docker Compose for the setup 2 is as below

```
version: '2'

services:

  elasticsearch:
    build:
      context: elasticsearch/
    volumes:
      - "./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro"
      - "./esdata:/usr/share/elasticsearch/data"
    ports:
      - "16022:16022"
      - "16021:16021"
    environment:
      ES_JAVA_OPTS: "-Xmx256m -Xms256m"
      discovery.type: zen
      discovery.zen.ping.unicast.hosts: elasticsearch
    networks:
      - elk
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
<REST SAME AS SETUP 1>

```

And the elasticsearch yml file is as follows

```
# Default Elasticsearch configuration from elasticsearch-docker.
#
cluster.name: "docker-cluster_setup2"
network.host: 0.0.0.0
network.publish_host: <setup_2_ip>

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
#discovery.zen.minimum_master_nodes: 1

# Use single node discovery in order to disable production mode and avoid bootstrap checks
a# see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
#
discovery.type: zen

# Set a custom port for the node to node communication (9300 by default):
#
transport.tcp.port: 16022
# Set a custom port to listen for HTTP traffic:
#
http.port: 16021
search:
    remote:
        cluster_setup1: 
            seeds: <setup_1_ip>:16022

```

When attempting cross cluster search I am able to connect from setup 2 to setup 1 where as when I try from setup 1 to setup 2 I am getting timeout error

Query executed on setup 2  
curl -X GET "localhost:16021/cluster\_setup1:index1/\_count" -H 'Content-Type: application/json' -d'  
{  
"query": {  
"match\_all": {}

```
      }
}
'
{"count":61070,"_shards":{"total":5,"successful":5,"skipped":0,"failed":0}}

```

Query executed on setup 1  
curl -X GET "localhost:16021/cluster\_setup1:index1/\_count" -H 'Content-Type: application/json' -d'  
\> {  
\> "query": {  
\> "match\_all": {}  
\>  
\> }  
\> }  
\> '

```
{"error":{"root_cause":[{"type":"connect_transport_exception","reason":"[][<setup_2_ip>:16022] connect_timeout[30s]"}],"type":"transport_exception","reason":"unable to communicate with remote cluster [cluster_setup2]","caused_by":{"type":"connect_transport_exception","reason":"[][<setup_2_ip>:16022] connect_timeout[30s]"}},"status":500}

```

We are able to telnet to the corresponding ip:ports both the ways

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 22, 2018, 1:02pm UTC](https://discuss.elastic.co/t/single-node-cross-cluster-search/141574/2 "2018-08-22T13:02:41Z")

</div>

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