I'm testing Elasticsearch and I'm trying to create a simple cluster with 2 nodes on a single machine (on Fedora)
I'm launching a first instance named Node1:
sudo bin/elasticsearch -Des.node.name=Node1 -Des.http.port=9200
And a second instance named Node2 in another terminal:
sudo bin/elasticsearch -Des.node.name=Node2 -Des.http.port=9201
The console output is the following for both commands:
log4j:WARN No appenders could be found for logger (node).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
GET http://127.0.0.1:9200
gives me:
{
"status" : 200,
"name" : "Node1",
"version" : {
"number" : "1.1.1",
"build_hash" : "f1585f096d3f3985e73456debdc1a0745f512bbc",
"build_timestamp" : "2014-04-16T14:27:12Z",
"build_snapshot" : false,
"lucene_version" : "4.7"
},
"tagline" : "You Know, for Search"
}
and GET http://127.0.0.1:9201
gives me
{
"status" : 200,
"name" : "Node2",
"version" : {
"number" : "1.1.1",
"build_hash" : "f1585f096d3f3985e73456debdc1a0745f512bbc",
"build_timestamp" : "2014-04-16T14:27:12Z",
"build_snapshot" : false,
"lucene_version" : "4.7"
},
"tagline" : "You Know, for Search"
}
That looks good but now if I get the cluster health I have different results on 9200 and 9201:
GET http://127.0.0.1:9200/_cluster/health?pretty=true
{
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 6,
"active_shards" : 6,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 6
}
GET http://127.0.0.1:9201/_cluster/health?pretty=true
{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}
Why do I have only 1 node on the same cluster? Why is it green and also yellow? Looks like the cluster is not working...
How do I make this works? Where are the Zen Discovery logs?
Related questions:
sudo bin/elasticsearch
without any settings gives me the same result.. (with autogenerated node names and port) – Yves M.