I'm trying to make the health of my cluster green. According to the following elasticsearch documentation: When you add more nodes to a cluster, it automatically allocates replica shards. When all primary and replica shards are active, the cluster state changes to green.
source: https://www.elastic.co/guide/en/elasticsearch/reference/current/add-elasticsearch-nodes.html
So I created 2 elasticsearch instances with the following configuration files:
# Config File 1
cluster.name : PL
node.name : "Node-1"
node.master : true
node.data : true
network.host : "127.0.0.1"
http.port : 9200
discovery.zen.ping.unicast.hosts : ["127.0.0.1:9200", "127.0.0.1:9201"]
discovery.zen.minimum_master_nodes : 2
# Config File 2
cluster.name : PL
node.name : "Node-2"
node.master : true
node.data : true
network.host : "127.0.0.1"
http.port : 9201
discovery.zen.ping.unicast.hosts : ["127.0.0.1:9200", "127.0.0.1:9201"]
discovery.zen.minimum_master_nodes : 2
By running the following curl command : curl -GETX localhost:9200/_cluster/health?pretty=true
I should according the elasticsearch documentation (see link below) have 2 nodes on my cluster. However, my number of nodes remains at 1.
source: https://www.elastic.co/guide/en/elasticsearch/guide/current/_add_failover.html