Configuring Elasticsearch Cross Cluster Search(CCS)

Ecem Akti
Orion Innovation techClub
4 min readMay 16, 2022

Hello everyone, in this article we will cover how to configure cross clusters in Elasticsearch. Before we dive deep into how to set up Cross Cluster in Elasticsearch, we’ll take a look at data Elasticsearch and its concepts.

Elasticsearch
Elasticsearch

What is Elasticsearch?

Elasticsearch is a highly scalable open-source full-text search and analytics engine built on Apache Lucene and developed in Java.

It allows you to store, search, and analyze big volumes of data quickly and in near real-time. It is generally used as the underlying engine/technology that powers applications that have complex search features and requirements.

It uses a documentation-based structure rather than tables and schemas. It has extensive REST APIs for storing or searching data. It is also the main component of the ELK(Elasticsearch +Logstash + Kibana) stack.

Its backend components include Cluster, Node, Shards and Replicas. ELK cluster is a group of one or more Elasticsearch nodes instances that are connected together.

ELK Cluster Design

What is Cross Cluster Search?

Cross-cluster search (CCS) allows you to configure multiple remote clusters across different regions and providers and enable unified search queries across all configured clusters. This remote connection between Elasticsearch clusters functions as a one-way traffic flow on port 9300.

Why do we need CCS?

By using CCS, you can easily visualize and manage your multi-region Elasticsearch clusters on a Single Central Kibana.

CCS With Central Kibana Design

You can use a cross-cluster search to filter and analyze log data stored on clusters in different data centers.

Configuring CCS

To set up a Cross-Cluster search, you must fulfill the following prerequisites.

1. The local cluster must be defined.

The local cluster is the set used to initiate the cross-cluster search. In our example design, Cluster-US and Central Kibana are located in the same region. For this reason, master nodes of Cluster-US are defined in the Kibana Config file as follows.

server.port: 5601server.host: “kibana-ip-address”elasticsearch.hosts:[“http://master1_ip:9200","http://master_2_ip:9200","http://master_3_ip:9200"]

2. To perform a cross-cluster search, You must have at least one remote cluster.

To register a remote cluster, it is necessary to connect the local cluster to the nodes in the remote cluster using sniffing mode (default) or proxy mode.

2.1. Sniff mode, a cluster is created using 9300 port addresses of a name and node list. This mode requires the gateway node to have its broadcast addresses accessible to the local cluster.

2.2. Proxy mode, a cluster is created using a name and a single proxy address. Proxy mode does not require remote cluster nodes to have accessible broadcast addresses.

Open Central Kibana dashboard, then go to Management > Stack Management > Remote Clusters.

Remote Cluster

To set up a new remote, click Add a remote cluster. Give the cluster a unique name and define the seed nodes for cluster discovery.

Cluster-US defined a local cluster in Central Kibana is defined in sniff mode and click save button.

Add Sniff Mode

APAC and EMEA clusters are also defined by proxy mode and click save button.

Add Proxy Mode

You can see that all the regions are connected to the Central Kibana.

Remote Clusters

3. To create an index pattern to search across clusters, use the same syntax that you’d use in a raw cross-cluster search request in Elasticsearch: <cluster-names>:<pattern>.

Open Central Kibana dashboard then go to Management > Stack Management > Kibana > Index patterns > Create index pattern

Create Index Pattern

You can view the index pattern you created in the discover section.

Discover

Today we completed the CCS configuration at Elasticsearch.

Thanks for reading! See you in my next post.

--

--