Fresh V7.5.2 installation - Windows 10

These are the steps I used.
unzip elasticsearch.zip in folder, launch elasticsearch.bat from cmd window
unzip kibana zip in separate folder and launch kibana.bat from cmd window
Launched kibana console from Browser, using localhost:5601

Did I miss anything?

I ask because the health status shows yellow.

GET _cat/health?v

Result

epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1586457605 18:40:05  elasticsearch yellow          1         1     12  12    0    0        9             0                  -                 57.1%

Also the following command shows some problems.

GET /_cluster/allocation/explain?pretty

Result

{
  "index" : "website",
  "shard" : 0,
  "primary" : false,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "CLUSTER_RECOVERED",
    "at" : "2020-04-09T00:11:11.195Z",
    "last_allocation_status" : "no_attempt"
  },
  "can_allocate" : "no",
  "allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",
  "node_allocation_decisions" : [
    {
      "node_id" : "DxiVy64ySTaq058I5Gef9w",
      "node_name" : "HOMEPC",
      "transport_address" : "127.0.0.1:9300",
      "node_attributes" : {
        "ml.machine_memory" : "8454520832",
        "xpack.installed" : "true",
        "ml.max_open_jobs" : "20"
      },
      "node_decision" : "no",
      "deciders" : [
        {
          "decider" : "same_shard",
          "decision" : "NO",
          "explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[website][0], node[DxiVy64ySTaq058I5Gef9w], [P], s[STARTED], a[id=-9r8SzxTQDqAlpB0gvWJBg]]"
        }
      ]
    }
  ]
}

I could add some data. (Agree that the syntax is now deprecated.)

PUT myindex/mytype/1
{
  "body": "here"
}

GET myindex/mytype/1
#! Deprecation: [types removal] Specifying types in document get requests is deprecated, use the /{index}/_doc/{id} endpoint instead.
{
  "_index" : "myindex",
  "_type" : "mytype",
  "_id" : "1",
  "_version" : 1,
  "_seq_no" : 0,
  "_primary_term" : 1,
  "found" : true,
  "_source" : {
    "body" : "here"
  }
}

But the cluster health for the index is yellow.

GET _cluster/health/myindex

Result

{
  "cluster_name" : "elasticsearch",
  "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" : 57.14285714285714
}

Please check and advise if I need to take any corrective measure.

Thank you

Probably because there is a replica for the index.

By default, the newly created index will have 1 replica and 5 shards, which means besides the primary shard, it will need an additional node for storing the replica shard. The primary shard and replica shard should not be on the same node, which reflects on the decision error message "same_shard".

To fix this for index creating in the future, you can either

  1. Specify the number_of_replicas on the index setting
  2. Add a default index template with number_of_replicas configured

To fix the current problem, you can

  1. Add another data node
  2. Change the number_of_replicas on the index setting for you index "myindex". You can find an example HERE

@oneoneonepig - Thanks for your response. I am actually working in a single computer (my home PC). So, is there a way to avoid addition of data node and having no replica? You mentioned about setting up default index template with number_of_replicas configured. Can you please send me more information about that? I can first delete the current index (as I hardly added anything significant as yet) and start after reconfiguring. Thank you

========
I also plan to try your other suggestion of changing number of replicas real time -

PUT /twitter/_settings
{
    "index" : {
        "number_of_replicas" : 2
    }
}

@oneoneonepig - I would like to report that index health goes from yellow to green, after I forced "no replicas" using syntax as suggested by you. But overall health still shows yellow. Do you have any other suggestion to fix other outstanding issues and get everything to green status? Thank you.

Step-1 - Force "no replicas"

PUT /myindex/_settings
{
  "index" : {
  "number_of_replicas" : 0
  }
}

Result

{
  "acknowledged" : true
}

Step-2 : Check health of index

GET _cluster/health/myindex

Result shows green status

{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "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" : 0,
  "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" : 100.0
}

Step-3 : Added new documents to myindex and searched. Working as expected.

Step-4 : Check overall health

GET _cat/health?v

Result - still yellow (no change)

Step-5 : Run the following test

GET /_cluster/allocation/explain?pretty

Result still shows problems

{
  "index" : "website",
  "shard" : 0,
  "primary" : false,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "CLUSTER_RECOVERED",
    "at" : "2020-04-09T00:11:11.195Z",
    "last_allocation_status" : "no_attempt"
  },
  "can_allocate" : "no",
  "allocate_explanation" : "cannot allocate because allocation is not permitted to any of the nodes",
  "node_allocation_decisions" : [
    {
      "node_id" : "DxiVy64ySTaq058I5Gef9w",
      "node_name" : "HOMEPC",
      "transport_address" : "127.0.0.1:9300",
      "node_attributes" : {
        "ml.machine_memory" : "8454520832",
        "xpack.installed" : "true",
        "ml.max_open_jobs" : "20"
      },
      "node_decision" : "no",
      "deciders" : [
        {
          "decider" : "same_shard",
          "decision" : "NO",
          "explanation" : "the shard cannot be allocated to the same node on which a copy of the shard already exists [[website][0], node[DxiVy64ySTaq058I5Gef9w], [P], s[STARTED], a[id=-9r8SzxTQDqAlpB0gvWJBg]]"
        }
      ]
    }
  ]
}

@debasisc I guess on step 3, you've added some new indices and they have 1+ replica shards. As you see in step 5, you can find out that the index name is "website".

@oneoneonepig - Thank you. I suppose these entries are created for demo purpose. I forced number of replicas to zero for all these -
accounts, accounts2, accounts3, customer, library, megacorp, twitter, website.

  1. After that overall health appears green. That is good news.
GET _cat/health?v

Result

epoch      timestamp cluster       status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1586621417 16:10:17  elasticsearch green           1         1     12  12    0    0        0             0                  -                100.0%
  1. However, the following command now shows a different problem.
GET /_cluster/allocation/explain?pretty

shows

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false]"
  },
  "status": 400
}
  1. I tested simple search operation on the index (myindex) which I created earlier. That seems to work well.
GET /myindex/_search 
  1. I could also insert more document into existing index myindex.
PUT myindex/_doc/3
{
  "type": "mytype", "body": "everywhere"
} 

Let me know if I should take any more steps to cure the issue as revealed in step-2 above.

Thank you for your help.

@debasisc

Step 2 is not a problem, it shows that there are no unassigned shards, which is good.

Also, you can use index templates to make future created indices to have a certain configuration. For example,

PUT _template/template_1
{
  "index_patterns": ["*"],
  "settings": {
    "number_of_replicas": 0
  }
}

Thanks @oneoneonepig - Much appreciated. You may close this ticket now. Thank you

You can mark the comment as a Solution if you think it solves your problem :slight_smile:

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