# Elasticsearch 6.7.0 status Yellow in Magento 2.3.1

**URL:** <https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018>\
**Category:** Elasticsearch\
**Created:** [April 2, 2019, 2:23pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018 "2019-04-02T14:23:15Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 2, 2019, 2:23pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/1 "2019-04-02T14:23:15Z")

</div>

I have an Ubuntu 18.04 system installed on a Digital Ocean server. I have installed the Magento 2.3.1 version. I have installed Java and Elasticsearch using the following commands:

**JAVA**

> sudo add-apt-repository -y ppa:webupd8team/java  
> sudo apt-get -y update  
> sudo apt-get install -y oracle-java8-installer

**ELASTICSEARCH**

> wget -qO - [https://artifacts.elastic.co/GPG-KEY-elasticsearch](https://artifacts.elastic.co/GPG-KEY-elasticsearch) | sudo apt-key add -  
> echo "deb [https://artifacts.elastic.co/packages/6.x/apt](https://artifacts.elastic.co/packages/6.x/apt) stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list  
> sudo apt update  
> sudo apt install elasticsearch  
> Edit this file: /etc/elasticsearch/elasticsearch.yml and add this info: network.host: localhost  
> sudo systemctl daemon-reload  
> sudo systemctl start elasticsearch  
> sudo systemctl enable elasticsearch

If I execute this command:

> curl -XGET -H "Content-Type: application/json" [http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)

This is the result:

> {  
> "cluster\_name" : "elasticsearch",  
> "status" : "yellow",  
> "timed\_out" : false,  
> "number\_of\_nodes" : 1,  
> "number\_of\_data\_nodes" : 1,  
> "active\_primary\_shards" : 20,  
> "active\_shards" : 20,  
> "relocating\_shards" : 0,  
> "initializing\_shards" : 0,  
> "unassigned\_shards" : 20,  
> "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  
> }

The status is yellow and unassigned\_shards is 20. How can I solve this problem?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 2, 2019, 3:19pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/2 "2019-04-02T15:19:32Z")

</div>

The status is yellow because you have unassigned shards. The [allocation explain API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html) is normally a good way to explain why they are unassigned.

In this case you have one node, but I think your indices all have `number_of_replicas: 1` (which is the default). The primary of each shard is assigned to your one node, but there is no other node to hold the replica. Either add a second node to your cluster, or set `number_of_replicas: 0` on each index.

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 2, 2019, 3:45pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/3 "2019-04-02T15:45:43Z")

</div>

Thank you very much for your reply. I am very new to Elasticsearch, could you tell me how I can solve this problem please?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 2, 2019, 4:35pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/4 "2019-04-02T16:35:52Z")

</div>

Here:

> [@DavidTurner](#):
>
> Either add a second node to your cluster, or set `number_of_replicas: 0` on each index.

See also [Update index settings API | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html) and [Index Templates | Elasticsearch Guide [6.7] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/indices-templates.html)

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 2, 2019, 4:51pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/5 "2019-04-02T16:51:45Z")

</div>

Thank you very much for your advice. Could you tell me a website where you can read the difference between creating a new node and putting each index to zero? (Or if you can explain it to me I would appreciate it)

Is it possible that the slowness of my website is due to this? (my website is a Magento 2)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 2, 2019, 5:19pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/6 "2019-04-02T17:19:52Z")

</div>

Sure, there's loads of introductory material linked from the pages I've suggested:

[https://www.elastic.co/webinars/getting-started-elasticsearch?baymax=rtp&elektra=docs&storm=top-video](https://www.elastic.co/webinars/getting-started-elasticsearch?baymax=rtp&elektra=docs&storm=top-video)

[https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html)

It's unlikely that the yellow health status is the cause is your website's performance issues, however.

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 3, 2019, 7:16am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/7 "2019-04-03T07:16:15Z")

</div>

@DavidTurner Do you think this warning is easy to solve?

> warning: Falling back to java on path. This behavior is deprecated. Specify JAVA\_HOME

When I execute this order this is the result:

> $ java -version  
> java version "1.8.0\_201"  
> Java(TM) SE Runtime Environment (build 1.8.0\_201-b09)  
> Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

and:

> $ echo $JAVA\_HOME  
> /usr/lib/jvm/java-8-oracle

How can I solve this problem?

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 3, 2019, 1:46pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/8 "2019-04-03T13:46:13Z")

</div>

@DavidTurner I have been researching and I can not add a new node from the terminal, could you help me please?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 3, 2019, 2:42pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/9 "2019-04-03T14:42:07Z")

</div>

> [@manue](#):
>
> could you help me please?

Sure, if you cannot add a new node then the other alternative is to set `number_of_replicas: 0` on all your indices. There's a link above about how to adjust the settings on an index, but here it is again:

> **[Update index settings API | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html)**

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 3, 2019, 2:54pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/10 "2019-04-03T14:54:41Z")

</div>

For this, I used this sentence:

curl -XPUT "localhost:9200/\*/\_settings" -H 'Content-Type: application/json' -d' { "index" : { "number\_of\_replicas":0 } '

But I received this error:

{"error":{"root\_cause":[{"type":"json\_e\_o\_f\_exception","reason":"Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3f073516; line: 1, column: 2])\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3f073516; line: 1, column: 87]"}],"type":"json\_e\_o\_f\_exception","reason":"Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3f073516; line: 1, column: 2])\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@3f073516; line: 1, column: 87]"},"status":500}

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 3, 2019, 4:11pm UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/11 "2019-04-03T16:11:19Z")

</div>

> [@manue](#):
>
> `{ "index" : { "number_of_replicas":0 }`

The key part of the error message is `expected close marker for Object`: your JSON is syntactically invalid because it is missing a closing brace. Try this:

` { "index" : { "number_of_replicas":0 }}`

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 4, 2019, 6:41am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/12 "2019-04-04T06:41:57Z")

</div>

It has been fixed! Thank you so much for your help! One more question, Magento now needs to use Elasticsearch to manage the database. I have Elasticsearch installed on the same server as Magento. Could you tell me if this is a good practice?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 5, 2019, 7:22am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/13 "2019-04-05T07:22:43Z")

</div>

> [@manue](#):
>
> I have Elasticsearch installed on the same server as Magento. Could you tell me if this is a good practice?

It's not unusual for a small system. I don't know anything about Magento, I'm afraid, but as a general principle you'll have to be aware of a couple of issues:

- you only have the resources of a single server available to do all the work. Perhaps this is enough, perhaps it's not - it depends on how heavily you're using it.

- you only have one Elasticsearch node. If it breaks (e.g. the disk becomes corrupt) then you will lose data.

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 5, 2019, 7:35am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/14 "2019-04-05T07:35:40Z")

</div>

How can a node be broken and data lost?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 5, 2019, 7:47am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/15 "2019-04-05T07:47:46Z")

</div>

Disks are one of the least reliable components of a server, and they fail (or silently corrupt data) with surprising frequency. A good quality disk might be within spec if it only corrupts one in every 10^14 bits, but that's only 11TB of data, and [some people report much higher error rates](https://www.zdnet.com/article/data-corruption-is-worse-than-you-know/).

---

<div class="post-metadata">

**Author:** ![manue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@manue](https://discuss.elastic.co/u/manue)\
**Post date:** [April 5, 2019, 8:06am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/16 "2019-04-05T08:06:39Z")

</div>

My disk is SSD, this helps the node not break?

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 5, 2019, 8:10am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/17 "2019-04-05T08:10:41Z")

</div>

No, SSDs are also not 100% reliable, and their reliability degrades over time.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 3, 2019, 8:10am UTC](https://discuss.elastic.co/t/elasticsearch-6-7-0-status-yellow-in-magento-2-3-1/175018/18 "2019-05-03T08:10:45Z")

</div>

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