Skip to main content
Skip table of contents

Elasticsearch troubleshooting & useful commands

  1. check status by running command:

CODE
bash /etc/veridiumid/scripts/check_services.sh

Status explained:

  • it presents the number of servers in the cluster (node.total = 6)

  • it presents the overall status: green, yellow, red

    • green means that everything is fine

    • yellow that not all nodes are up or some shards needs to be reallocated (the system is still functional)

    • red - elasticsearch is not fully functional.

  • pending/unassing tasks

    • the number of tasks (ex. moving shards from one server to other)

Backup :

Backup is done incrementally, for the data and needs to be executed on one node, in crontab. For more details, see article Disaster Recovery

Useful commands:

CODE
## list the indices
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -l 

## get help for _cat commands
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=GET -p=/_cat

## modify number of replicas
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=PUT -p=/veridium.*/_settings -d='{"index":{"number_of_replicas":3}}'

## get nodes, indices, allocation of shards
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=GET -p=/_cat/nodes?v
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=GET -p=/_cat/indices?v
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=GET -p=/_cat/allocation?v   ## here you can see how many shards need to be realocated
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=GET -p=/_cat/shards         ## see how shards are allocated to each node
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=GET -p=/_cluster/allocation/explain?pretty   ## shards realocation reasons

## delete an indices
bash /opt/veridiumid/elasticsearch/bin/elasticsearch_ops.sh -x=DELETE -p=/veridiumid.sessions-2023-03

##make and index readable
eops -x=PUT -p=/veridium.sessions-2023-08/_settings -d='{"settings":{"index.blocks.write":true}}'
###clone an index
eops -x=POST -p=/veridium.sessions-2023-08/_clone/veridiumbck.sessions-2023-08
##make and index writtable
eops -x=PUT -p=/veridium.sessions-2023-08/_settings -d='{"settings":{"index.blocks.write":false}}'

## copy the content of an index to the new index.
eops -x=POST -p=/_reindex -d='{"source":{"index":"veridium.sessions_history-2023-06"},"dest":{"index":"veridiumbck.sessions_history-2023-06"}}'

eops -x=DELETE -p=/veridiumbck.sessions_history-2023-06
eops -x=POST -p=/veridium.*/_flush
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.