ais cluster command
The ais cluster command is the main tool for monitoring and managing an AIS (AIStore) cluster. It provides functionalities to
- add or remove nodes
- change the primary gateway
- join (or merge) two AIS clusters, and
- perform a variety of administrative operations.
The command has the following subcommands:
Important: with the single exception of
add-remove-nodes, all the other the commands listed above operate on the level of the entire cluster. Node level operations (e.g., shutting down a given selected node, etc.) can be found underadd-remove-nodes.
Alternatively, use --help to show subcommands with brief descriptions:
As always, each subcommand will have its own help and usage examples, the latter possibly spread across multiple documents.
Note: for any keyword or text of any kind, you can easily look up examples and descriptions via a simple
findorgit grep, for instance:
Note that there is a single CLI command to grow a cluster, and multiple commands to scale it down.
Scaling down can be done gracefully or forcefully, and also temporarily or permanently.
For background, usage examples, and details, please see Node lifecycle: maintenance, shutdown, decommission.
Adding/removing nodes
The corresponding functionality can be found under the subcommand called add-remove-nodes:
Table of Contents
- Cluster Dashboard
- Cluster and Node status
- Show cluster map
- Show cluster stats
- Show disk stats
- Managing cluster membership
- Join a node
- Remove a node
- Remote AIS cluster
- Remove a node
- Reset (ie., zero out) stats counters and other metrics
- Reload backend credentials
- Download log archive
Cluster Dashboard
ais show dashboard (alias: ais cluster dashboard) provides an at-a-glance view of cluster health, performance, and configuration. The dashboard consolidates the most important operational metrics into a single command, making it ideal for quick status checks and continuous monitoring.
Command Overview
Output Sections
The dashboard displays two main sections:
Performance and Health:
Cluster:
Examples
Basic dashboard view:
Continuous (Throughput) monitoring:
JSON output:
Verbose mode (shows detailed issue breakdown when problems detected):
Related Commands
ais show cluster- Detailed node-by-node statusais show performance- Detailed performance metricsais show storage- Storage-specific details
Cluster and Node status
The command has a rather long(ish) short description and multiple subcommands:
To quickly exemplify, let’s assume the cluster has a (target) node called t[xyz]. Then:
Main CLI dashboard: all storage nodes and gateways, deployed version, capacity, memory, and runtime stats:
same as above, with only targets selected
show specific target
ask specific target to show its cluster map
and so on and so forth.
Notes
The last example (above) may potentially make sense when troubleshooting. Otherwise, by design and implementation, cluster map (
Smap), bucket metadata (BMD), and all other cluster-level metadata exists in identical protected and versioned replicas on all nodes at any given point in time.
Still, to display cluster map in its (JSON) fullness, run:
--jsonoption is almost universally supported in CLI
Similar to all other
showcommands,ais cluster showis an alias forais cluster show. Both can be used interchangeably.
Options
Examples
Show cluster map
ais show cluster smap [NODE_ID]
Show a copy of the cluster map (Smap) stored on NODE_ID.
If NODE_ID is not given, show cluster map from (primary or secondary) proxy “pointed to” by your local CLI configuration (ais config cli) or AIS_ENDPOINT environment.
Note that cluster map (
Smap), bucket metadata (BMD), and all other cluster-level metadata exists in identical protected and versioned replicas on all nodes at any given point in time.
Useful variations include ais show cluster smap --json (to see the unabridged version), and also:
The latter will periodically (until Ctrl-C) show cluster map in 5-second intervals - might be useful in presence of any kind of membership changes (e.g., cluster startup).
Options
Examples
Show smap from a given node
Ask a specific node for its cluster map (Smap) replica:
Show cluster stats
ais show cluster stats is a alias for ais show performance.
The latter is the primary implementation, and the preferred way to investigate cluster performance, while ais show cluster stats is retained in part for convenience and in part for backward compatibility.
See also:
Show disk stats
ais show storage disk [TARGET_ID] - show disk utilization and read/write statistics
When TARGET_ID is not given, disk stats for all targets will be shown and aggregated.
Options
Examples
Display disk reports stats N times every M seconds
Display 5 reports of all targets’ disk statistics, with 10s intervals between each report.
Managing cluster membership
The ais cluster add-remove-nodes command supports adding, removing, and maintaining nodes within the cluster. It allows administrators to dynamically adjust the cluster’s composition, handle maintenance operations, and ensure availability and correctness during transitions when nodes are added or removed.
Join a node
AIStore has two kinds of node: proxie (gateways) and targets (storage nodes). That’s why --role is a mandatory option that must have one of the two values:
--role=proxyor--role=target
Note: aisnode will try to join cluster using its persistent ID. If you need to specify an ID, you can do so via
aisnodeexecutable command line.
Example: join a proxy node
Any proxy can be potentially elected as primary; to mark certain proxies as non-electable, run (e.g.):
Remove a node
Temporarily remove an existing node from the cluster
ais cluster add-remove-nodes start-maintenance NODE_ID
ais cluster add-remove-nodes stop-maintenance NODE_ID
Starting maintenance puts the node in maintenance mode, and the cluster gradually transitions to
operating without the specified node (which is labeled maintenance in the cluster map). Stopping
maintenance will revert this.
ais cluster add-remove-nodes shutdown NODE_ID
Shutting down a node will put the node in maintenance mode first, and then shut down the aisnode
process on the node.
Permanently remove an existing node from the cluster
ais cluster add-remove-nodes decommission NODE_ID
Decommissioning a node will safely remove a node from the cluster by triggering a cluster-wide
rebalance first. This can be avoided by specifying --no-rebalance.
Options
Examples
Decommission node
Permananently remove proxy p[omWp8083] from the cluster:
To terminate aisnode on a given machine, use the shutdown command, e.g.:
Similar to the maintenance option, shutdown triggers global rebalanceng then shuts down the corresponding aisnode process (target t[23kfa10f] in the example above).
Temporarily put node in maintenance
Take a node out of maintenance
Remote AIS cluster
Given an arbitrary pair of AIS clusters A and B, cluster B can be attached to cluster A, thus providing (to A) a fully-accessible (list-able, readable, writeable) backend.
For background, terminology, and definitions, and for many more usage examples, please see:
Attach remote cluster
ais cluster remote-attach UUID=URL [UUID=URL...]
or
ais cluster remote-attach ALIAS=URL [ALIAS=URL...]
Attach a remote AIS cluster to a local one via the remote cluster public URL. Alias (a user-defined name) can be used instead of cluster UUID for convenience. For more details and background on remote clustering, please refer to this document.
Examples
Attach two remote clusters, the first - by its UUID, the second one - via user-friendly alias (two).
Detach remote cluster
ais cluster remote-detach UUID|ALIAS
Detach a remote cluster using its alias or UUID.
Examples
Example below assumes that the remote has user-given alias two:
Show remote clusters
ais show remote-cluster
Show details about attached remote clusters.
Examples
The following two commands attach and then show the remote cluster at the address my.remote.ais:51080:
Notice that:
- user can assign an arbitrary name (aka alias) to a given remote cluster
- the remote cluster does not have to be online at attachment time; offline or currently unreachable clusters are shown as follows:
Notice the difference between the first and the second lines in the printout above: while both clusters appear to be currently offline (see the rightmost column), the first one was accessible at some earlier time and therefore we show that it has (in this example) 10 storage nodes and other details.
To detach any of the previously configured associations, simply run:
Reset (ie., zero out) stats counters and other metrics
ais cluster reset-stats
Example and usage
Let’s go ahead and reset all error counters:
Reload backend credentials
The ais cluster reload-backend-creds command provides for adding new or updating existing backend credentials at runtime.
This improvement addresses a common scenario we encountered prior to version 3.26:
- A new potential user requests access to a given AIS cluster.
- The user already has an S3 bucket (or it could be a GCP, Azure, or OCI bucket).
- We verify that the cluster has network access to the user’s bucket.
- We need to add the user’s credentials to allow AIS nodes to access the bucket.
Before version 3.26, the final step required a cluster restart. But now, with reload-backend-creds, you can seamlessly add or update credentials without any downtime.
Download log archive
The command is ‘ais cluster download-logs’ or, same, ‘ais log get cluster’.