MageHost - Manage ElasticSearch

Gewijzigd op Di, 20 Dec, 2022 om 1:05 PM

Disclaimer: MageHost has joined forces with Savvii. Therefore, these articles are only relevant to existing MageHost customers. For more information on this, visit www.savvii.com/en/magehost.  


You can ask us to install ElasticSearch on your hosting account. Make sure you mention which exact version you would like.


ElasticSearch IP and Port

We will run the ElasticSearch daemon on the IP address of your hosting account

We will use the default port for ElasticSearch, which is 9200

The communication with ElasticSearch works via the REST / HTTP protocol.

For security reasons port 9200 is not directly accessible from outside the hosting server.

The easiest way is to access ElasticSearch using curl commands via SSH, examples below.


Manage ElasticSearch using Curl

These commands can be executed when you are connected via SSH to the hosting account where the ElasticSearch is used.

Check ElasticSearch is running

This command will show the version of ElasticSearch and the tagline "You Know, for Search".

curl http://$VHOSTIP:9200

Cluster Nodes and Health

curl "http://$VHOSTIP:9200/_cat/nodes?v"
curl "http://$VHOSTIP:9200/_cluster/health?pretty"

Delete all data - be careful!

curl -H 'Content-Type: application/json' -XDELETE "http://$VHOSTIP:9200/*"

List Indexes + Status green/yellow/red

curl "http://$VHOSTIP:9200/_cat/indices?v"

List ElasticSearch plugins

curl "http://$VHOSTIP:9200/_cat/plugins?v"

Fix ElasticSearch status Yellow

There is probably only one ElasticSearch node running for your shop, unless your shop is on a cluster of servers. The ElasticSearch status can become "Yellow" because ElasticSearch likes to spread replica's of data among multiple nodes. To make ElasticSearch "Green" again, execute the following commands:

curl -H "Content-Type: application/json" -XPUT "http://$VHOSTIP:9200/_settings" -d '{"index":{"number_of_replicas":0}}'
curl -H 'Content-Type: application/json' -XPUT "http://$VHOSTIP:9200/_cluster/settings" -d '{"transient":{"cluster.routing.allocation.enable":"all"}}'

Access ElasticSearch from your Browser or Desktop Application

On Linux or macOS

If you would like to access ElasticSearch from your desktop or browser, you need create a TCP Tunnel over SSH. Replace the __USER__@__DOMAIN__  by the values you normally use to connect to SSH. You can find the value __VHOSTIP__ as described in the first paragraph of this article.

ssh  __USER__@__DOMAIN__  -p 2222  -L 9200:__VHOSTIP__:9200

As long as this connection is open, you can access ElasticSearch in your browser or desktop application on http://localhost:9200

On Windows using PuTTY

First make sure you have a working SSH connection configured to the hosting account where want to manage ElasticSearch. Next you can add the settings below and save the session again using the 'Session' category on top of the Configuration tree. You can find the value __VHOSTIP__ as described in the first paragraph of this article.

As long as the Putty connection is open, you can access ElasticSearch in your browser or desktop application on http://localhost:9200


Was dit artikel nuttig?

Dat is fantastisch!

Hartelijk dank voor uw beoordeling

Sorry dat we u niet konden helpen

Hartelijk dank voor uw beoordeling

Laat ons weten hoe we dit artikel kunnen verbeteren!

Selecteer tenminste een van de redenen
CAPTCHA-verificatie is vereist.

Feedback verzonden

We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren