Elasticsearch cluster state yellow and have unassigned shards


(vamshi) #1

Hi,

I have installed Elasticsearch 5.5.4, Kibana 5.5.4 on the same node (1 node cluster). My elasticsearch cluster state turned to "yellow" and I'm having 14 unassigned shards. Can you please let me know how to work on them?

Also, I found following in my log file. Can you please let me know what is happening?

[2018-10-31T14:03:54,384][DEBUG][o.e.a.s.TransportSearchAction] [es-node01] [bit                                                                                                                               bucket-search][2], node[Qqi2yfxRQ-S5rwANaNWfwA], [P], s[STARTED], a[id=KsBf54j0Q                                                                                                                               -icZvKUvHb5KQ]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, in                                                                                                                               dices=[bitbucket-search], indicesOptions=IndicesOptions[id=38, ignore_unavailabl                                                                                                                               e=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_clo                                                                                                                               sed=false, allow_alisases_to_multiple_indices=true, forbid_closed_indices=true],                                                                                                                                types=[repository], routing='null', preference='null', requestCache=null, scrol                                                                                                                               l=null, source={
  "from" : 0,
  "size" : 25,
  "query" : {
    "bool" : {
      "must" : [
        {
          "bool" : {
            "disable_coord" : false,
            "adjust_pure_negative" : true,
            "boost" : 1.0
          }
        }
      ],
      "filter" : [
        {
          "term" : {
            "originId" : {
              "value" : 32,
              "boost" : 1.0
            }
          }
        }
      ],
      "should" : [
        {
          "constant_score" : {
            "filter" : {
              "term" : {
                "projectId" : {
                  "value" : 103,
                  "boost" : 1.0
                }
              }
            },
            "boost" : 10.0
          }
        }
      ],
      "disable_coord" : false,
      "adjust_pure_negative" : true,
      "boost" : 1.0
    }
  },
  "sort" : [
    {
      "_score" : {
        "order" : "desc"
      }
    },
    {
      "quickSearchProjectName.raw" : {
        "order" : "asc"
      }
    },
    {
      "quickSearchRepositoryName.raw" : {
        "order" : "asc"
      }
    }
  ]
}}] lastShard [true]
org.elasticsearch.transport.RemoteTransportException: [es-node01][10.X.X.X:930                                                                                                                               0][indices:data/read/search[phase/query]]
Caused by: org.elasticsearch.index.query.QueryShardException: No mapping found f                                                                                                                               or [quickSearchProjectName.raw] in order to sort on
        at org.elasticsearch.search.sort.FieldSortBuilder.build(FieldSortBuilder                                                                                                                               .java:262) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.sort.SortBuilder.buildSort(SortBuilder.java:                                                                                                                               156) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.parseSource(SearchService.java                                                                                                                               :630) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.createContext(SearchService.ja                                                                                                                               va:481) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.createAndPutContext(SearchServ                                                                                                                               ice.java:457) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.search.SearchService.executeQueryPhase(SearchServic                                                                                                                               e.java:253) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.action.search.SearchTransportService$6.messageRecei                                                                                                                               ved(SearchTransportService.java:330) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.action.search.SearchTransportService$6.messageRecei                                                                                                                               ved(SearchTransportService.java:327) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.transport.RequestHandlerRegistry.processMessageRece                                                                                                                               ived(RequestHandlerRegistry.java:69) ~[elasticsearch-5.5.3.jar:5.5.3]
        at org.elasticsearch.transport.TransportService$7.doRun(TransportService                                                                                                                               .java:644) [elasticsearch-5.5.3.jar:5.5.3]

(David Turner) #2

The allocation explain API will tell you why unassigned shards are unassigned. Since you have a single node cluster, I think this means that you have some indices with number_of_replicas set to a value greater than zero (by default it's 1). The difference between yellow and green doesn't really matter in a single-node cluster, both of them mean that all the primary shards are assigned and that's the best you can do with just one node.


(vamshi) #3

Thank you! I have system indices which have unassigned shards as I'm not having another node. I turned number_of_replicas to 0 for my actual index. But, can you please explain about the above stacktrace?


(David Turner) #4

The log seems quite mangled - it has a lot of extra spaces in it for some reason. Still, this line gives a clue:

Caused by: org.elasticsearch.index.query.QueryShardException: No mapping found for [quickSearchProjectName.raw] in order to sort on

Without a mapping for this field, Elasticsearch doesn't know how to sort on it as requested by the quoted query:

    {
      "quickSearchProjectName.raw" : {
        "order" : "asc"
      }
    },

(system) #5

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