Friday, March 14, 2025

Elastic Cross-Cluster Ops - East Cluster Build

Summary

This is Part 2 in the three-part series on Elasticsearch (ES) cross-cluster operations.  This ES cluster will be implemented in Docker.  Like the West Cluster, this configuration yields a single ES node and one Kibana node. 

Architecture



Configuration

Docker-compose

For the most part, I used the reference docker-compose.  I added a bind mount such that I could add the West Cluster's transport CA to the trusted CAs for the East Cluster.


volumes:
- certs:/usr/share/elasticsearch/config/certs
- ${PWD}/../west/west-ca.crt:/usr/share/elasticsearch/config/remote/west-ca.crt
environment:
- xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt,remote/west-ca.crt

Index

Below a minimal index is built via the REST API.  This index is used in a demonstration of cross-cluster search in the next post.

echo -e "\n*** Create east_ccs index ***"
curl -s -k -u "elastic:elastic" "https://$EAST_ELASTIC_IP:9200/_bulk?pretty" \
-H "Content-Type: application/json" \
-d'
{ "index" : { "_index" : "east_ccs" } }
{"name": "Brave New World", "author": "Aldous Huxley", "release_date": "1932-06-01", "page_count": 268}
{ "index" : { "_index" : "east_ccs" } }
{"name": "The Handmaid'"'"'s Tale", "author": "Margaret Atwood", "release_date": "1985-06-01", "page_count": 311}
' > /dev/null
view raw xc-eastindex.sh hosted with ❤ by GitHub

Source