Elasticsearch¶
This section is about how to perform a specific task. If you want to understand how a certain component works, please see Reference
The rest of the page assumes you installed using the ansible playbooks from wire-server-deploy
For any command below, first ssh into the server:
For more information, see the elasticsearch documentation
How to rolling-restart an elasticsearch cluster¶
For maintenance you may need to restart the cluster.
On each server one by one:
- check your cluster is healthy (see above)
- stop shard allocation:
You should expect some output like this:
- Stop the elasticsearch daemon process:
systemctl stop elasticsearch
- do any operation you need, if any
- Start the elasticsearch daemon process:
systemctl start elasticsearch
- re-enable shard allocation:
You should expect some output like this from the above command:
- Wait for your cluster to be healthy again.
- Do the same on the next server.
How to manually look into what is stored in elasticsearch¶
See also the elasticsearch sections in Investigative tasks (e.g. searching for users as server admin).
Check the health of an elasticsearch node¶
To check the health of an elasticsearch node, run the following command:
You should see output looking like this:
Here, the green
denotes good node health, and the 3 3
denotes 3 running nodes.
Check cluster health¶
This is the command to check the health of the entire cluster:
List cluster nodes¶
This is the command to list the nodes in the cluster:
Troubleshooting¶
Description: ES nodes ran out of disk space and error message says: "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
Solution:
- Connect to the node:
- Clean up disk (e.g.
apt autoremove
on all nodes), then restart machines and/or the elasticsearch process
As always make sure you check the health of the process. before and after the reboot.
- Get the elastichsearch cluster out of read-only mode, run:
- Trigger reindexing: From a kubernetes machine, in one terminal:
And in a second terminal trigger the reindex: