ElasticSearch is a distributed search engine, so it needs to be clustered for high availability.
Here we just build three ElasticSearch clients on one computer to create pseudo-distribution and we can start our learning journey.
A. Decompress the package
Select * from elasticSearch-7.4.2-Windows-x86_64. zip file where you want to download elasticSearch-7.4.2-Windows-x86_64. zip file

2. Modify the configuration file
Modify elasticSearch. yml file in config folder:



Node1 Node configuration:
cluster.name: mytest-app
node.name: node-1
Network. The host: 127.0.0.1
http.port: 9200
transport.tcp.port: 9300
http.cors.enabled: true
http.cors.allow-origin: “*”
Discovery. Seed_hosts: [” 127.0.0.1:9300 “, “127.0.0.1:9301”, “127.0.0.1:9302”]
Cluster. Initial_master_nodes: [” 127.0.0.1:9300 “, “127.0.0.1:9301”, “127.0.0.1:9302”]





With node1 configured, the other two node2 and Node3 nodes only need to be modified slightly.
2 configuration:



Node3 configuration:



Once configured, start node1, node2, and node3 respectively:

Verify by typing http://localhost:9200/_cat/nodes in your browser after startup, and you’ll have a three-node cluster.

Create a new index on Kibana with two master shards and two slave shards:

The Health status of the index in cluster state is green (green stands for healthiest state):