Unable to find any relevant information for Running Elasticsearch on AWS - Windows Server thus as a gratitude for whether ever I have learnt from this forum, I have jotted down all the relevant steps to run your cluster in AWS for Windows Server.
- Run min 3 EC2 instances in AWS to form a highly available cluster in same Availability Zone for simplicity [As a best practice it can be run in multiple AZs]. Put all of the instances in the same security group and make sure port no. 9200 & 9300 are allowed in the inbound rule, in the source mention only the subnet of the following Availability Zone, it shouldn’t be opened to the world as a security best practices.
- Download ElasticSearch for windows from (http://www.elastic.co/downloads/elasticsearch) & create similar folder structure in all the instances and keep the zipped file there & extract it.
- Next we need to configure the elasticsearch.yml which is located inside config folder [Notepad++ recommended]. Kindly do the similar change in all the instances, uncomment the following parameters & write them up accordingly, make sure you mention private IP addr assigned to the instance or else it won’t work.
cluster.name: dev-cluster
node.name: ${HOSTNAME}
network.host: ["0.0.0.0"]
discovery.zen.ping.unicast.hosts: ["private-ip of node-1", " private-ip of node-2" , “private-ip of node-3”]
For e.x, discovery.zen.ping.unicast.hosts: ["172.31.56.159", "172.31.54.17" , “172.31.56.119”]
discovery.zen.minimum_master_nodes: 2 - Disable Windows Defender Firewall from control panel in all the EC2 instances.
- Run the cluster one by one by from command prompt by using the following cmd “ElasticSearchPath\bin\elasticsearch.bat”
- To check if all the nodes are added to the cluster or not , run the following in any web browser localhost:9200/_cluster/health?pretty
- Common issues, if you get following error [o.e.d.z.ZenDiscovery ] [node-name] failed to send join request to master , kindly stop cluster service in all the instances , delete the data folder from all the instances and re-start the service one-by-one.
- Thanks for reading.