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.
- Part 1: West Cluster Build
- Part 2: East Cluster Build
- Part 3: Replication + Search
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |