To use Elastic Search in cluster configure file config\elasticsearch.yml for every node as followed
-
Set the cluster name.
cluster-name=SomeClusterName -
Set the first node name.
node.name=SomeNodeName -
Set node will act as a master.
node.master=true -
Set node will act as a data-node.
node.data=true -
Set first node’s ip and port
network.host=IpOrUrl
http.port=9200 (or any other port) -
Cluster nodes discovery protocol and list of nodes (except current node)
discovery.zen.ping.unicast.hosts: ["IpOrUrl_0", "IpOrUrl_1"] -
Set any other parameters (path to indexes etc) in Elastic Search configuration file
After all nodes are configured start it.
To verify is all nodes in cluster are configured properly use the command
curl -XGET 'http://IpOrHost:9200_OrConfiguredPort/_cluster/state?pretty'