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:
The status is yellow because you have unassigned shards. The allocation explain API 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.
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)
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:
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:
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?
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.
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.