Elasticsearch cluster not success

I have two servers both installed Elasticsearch 5.3.0

And with both elasticsearch.yml, I've configed:

cluster.name: alfred
node.name: ${HOSTNAME}
network.host: localhost
discovery.zen.ping.unicast.hosts: ["10.0.6.35", "10.0.6.36"]

after restart both elasticsearch, I ran:

curl -XGET 'localhost:9200/_cluster/health?pretty'

output

{
  "cluster_name" : "alfred",
  "status" : "yellow",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 1,
  "active_shards" : 1,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 1,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 50.0
}

why my number_of_nodes still 1? shouldn't it be 2?

curl -X GET 'localhost:9200/_cluster/state?pretty'

output

{
  "cluster_name" : "alfred",
  "version" : 4,
  "state_uuid" : "MsBUYzJDTPiHugbFbtPwVw",
  "master_node" : "WO_y5kdDSbyDCqyhZTcXJQ",
  "blocks" : { },
  "nodes" : {
    "WO_y5kdDSbyDCqyhZTcXJQ" : {
      "name" : "ELK-Node1",
      "ephemeral_id" : "x8TGUy3MS5Cidg3yPy-6oQ",
      "transport_address" : "127.0.0.1:9300",
      "attributes" : { }
    }
  },
  "metadata" : {
...

only one node was listed.

BTW, both server's ufw was inactive.

I've figured out the cause of the problem.
in the configuration file, network.host should be the ip address of each node not localhost

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.