Elastic Healthcheck Commands

The elastic subcommand in Accelo Healthcheck helps you diagnose and manage Elasticsearch-related issues. It provides commonly used Elasticsearch diagnostic and maintenance operations through a single, secure command interface.

To view all available subcommands and flags, run:

accelo admin hc elastic --help

Available Subcommands

  • alias

  • cluster-health

  • cluster-settings

  • delete

  • health-report

  • shard-count


Default Behavior

By default, the following command lists all Elasticsearch indices for the specified environment:

accelo admin hc elastic -e <environment>

Commonly Used Flags

Flag

Description

-d <hostname/ip>

Specifies a custom Elasticsearch host if it is running on a different server

-i <index-name/regex>

Filters one or more indices by name or regular expression

-w

Displays output in a wide format

-p <port>

Specifies a non-default Elasticsearch port


Sample Output: List Indices

accelo admin hc elastic -e <environment>

Example output:

╔════════╦════════════════════════════════════╦═══════════════╦══════════╦═══════════╦════════════╗ ║ HEALTH ║ INDEX ║ PRIMARY SHARD ║ REPLICAS ║ DOC COUNT ║ STORE SIZE ║ ╚════════╩════════════════════════════════════╩═══════════════╩══════════╩═══════════╩════════════╝

Commands

Alias

Retrieves alias information for one or more indices.

Command:

accelo admin hc elastic alias -e <environment>

Sample output:

{ "actions_service-axn-actions_service-2025.01.28": { "aliases": {} } }

Cluster Health

Retrieves the health status of the Elasticsearch cluster.

Command:

accelo admin hc elastic cluster-health -e <environment>

Sample output:

INFO: elastic cluster health { "active_primary_shards": 355, "active_shards": 355, "active_shards_percent_as_number": 98.61111111111111, "cluster_name": "elasticsearch", "delayed_unassigned_shards": 0, "initializing_shards": 0, "number_of_data_nodes": 1, "number_of_in_flight_fetch": 0, "number_of_nodes": 1, "number_of_pending_tasks": 0, "relocating_shards": 0, "status": "yellow", "task_max_waiting_in_queue_millis": 0, "timed_out": false, "unassigned_shards": 5 }

Cluster Settings

Retrieves cluster-wide persistent and transient settings.

Command:

accelo admin hc elastic cluster-settings -e <environment>

Sample output:

{ "persistent": {}, "transient": {} }

Delete Index

Deletes one or more indices from the Elasticsearch cluster.

accelo admin hc elastic delete -e XXXXXXXXXXXX -i <indexName>

To delete multiple indices, give -m flag, when -m is used -i flag can be used as regex and multiple indices can be deleted.

Sample output:

[root@odppulse201:acceldata (ad-default)]$ accelo admin hc elastic delete -e XXXXXX -i 2025.01.12 -m INFO: index 'smokey-hdfs-audit-2025.01.12' deleted successfully INFO: index 'smokey-logs-hbase_master-warn-2025.01.12' deleted successfully INFO: index 'smokey-logs-hive_server-warn-2025.01.12' deleted successfully INFO: index 'smokey-logs-yarn_timelinereader-warn-2025.01.12' deleted successfully INFO: index 'smokey-logs-yarn_timelineserver-warn-2025.01.12' deleted successfully INFO: index 'smokey-logs-hdfs_datanode-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-oozie_server-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-hive_server-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-zookeeper-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-mapred_historyserver-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-nifi-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-kafka_server_gc-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-hdfs_namenode-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-hbase_regionserver-warn-2025.01.12' deleted successfully INFO: index 'smokey-logs-yarn_resourcemanager-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-hbase_master-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-yarn_timelineserver-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-hbase_regionserver-info-2025.01.12' deleted successfully INFO: index 'smokey-logs-yarn_nodemanager-info-2025.01.12' deleted successfully

Health Report

Retrieves a detailed health report for the Elasticsearch cluster.

Command:

accelo admin hc elastic health-report -e <environment>

Shard Count

Updates the number of shards configured for the Elasticsearch cluster.

Command:

accelo admin hc elastic shard-count -e <environment> -s <new-shard-count>

Sample output:

INFO: shard count altered successfully

After updating the shard count, use the cluster-settings command to verify the change.