elasticsearch-node
Start Elasticsearch node
TLDR
Display information about the current node
Prepare the node for a full cluster restart (e.g., after upgrading)
Repurpose a node for a different role (e.g., from master to data node)
List the roles assigned to the node
Show the installed JVM version, Elasticsearch home path, and other diagnostic information
Display help
SYNOPSIS
elasticsearch-node <command> [<options>]
Common Usage Examples:
elasticsearch-node list
elasticsearch-node stats
elasticsearch-node repurpose --master my_node_name
elasticsearch-node unsafe-bootstrap
PARAMETERS
list
Lists all nodes currently registered with the Elasticsearch cluster, displaying their name, ID, roles, and other relevant information.
stats
Retrieves and displays various detailed statistics about the Elasticsearch node, including JVM metrics, OS information, process details, and thread pool metrics.
repurpose <node_name> --master|--data|--ingest
Changes the role of a specified node within the cluster. For instance, it can be used to make a data node eligible to become a master node. Requires the node name and appropriate role options.
unsafe-bootstrap
Used to bootstrap a single-node Elasticsearch cluster from a non-bootstrapped state. This command should be used with extreme caution and only in specific disaster recovery scenarios when all master-eligible nodes are lost.
--help
Displays general help information for the elasticsearch-node command or specific help for a given subcommand.
DESCRIPTION
elasticsearch-node is a command-line utility provided with Elasticsearch, designed for administrators to manage specific aspects of an individual node's participation within an Elasticsearch cluster. Unlike the primary elasticsearch command which starts and runs an instance, elasticsearch-node focuses on node-level administrative tasks related to cluster topology and state. It enables operations such as listing all active nodes in the cluster, retrieving detailed statistics for a node, and performing advanced actions like changing a node's role (e.g., from a data node to a master-eligible node) or bootstrapping a single-node cluster under specific recovery scenarios. This tool helps in diagnosing cluster health, reconfiguring node roles, and ensuring proper cluster membership.
CAVEATS
Key Considerations:
elasticsearch-node operations (e.g., list, stats) typically require a running Elasticsearch instance or connectivity to a cluster.
The unsafe-bootstrap command is powerful and potentially destructive; use it only when absolutely necessary and understand its implications on cluster state.
The user executing the command must have appropriate file system permissions to access Elasticsearch's configuration and data directories.
The command is usually found in the ELASTICSEARCH_HOME/bin/ directory and might require navigating there or adding it to your system's PATH.
For secured clusters, proper authentication (e.g., API keys, username/password) or security configuration might be required.
EXECUTION CONTEXT
The elasticsearch-node command typically needs to be executed from the Elasticsearch installation directory's bin subdirectory. Alternatively, ensure that this directory is included in your system's PATH environment variable for direct access.
SECURITY CONSIDERATIONS
In a secure Elasticsearch cluster, interactions with elasticsearch-node may require proper authentication. This could involve providing API keys, usernames and passwords, or ensuring the security configuration allows the command to connect to the cluster successfully, especially when managing remote or production environments.
HISTORY
Elasticsearch, initially released in 2010, has continuously evolved its command-line toolset alongside its core functionality. As the platform grew in complexity and enterprise adoption, specialized utility scripts like elasticsearch-node were introduced. These tools abstract away lower-level API interactions, simplifying common administrative tasks related to node-level cluster membership, configuration, and diagnostics. The dedicated focus of elasticsearch-node on node roles and cluster state management reflects the increasing importance of robust cluster resilience and topological control in modern Elasticsearch deployments.