yb-admin is a command-line tool for advanced administration of YugabyteDB clusters.
Synopsis
Description
yb-admin invokes the YB-Master and YB-TServer servers to perform cluster administration tasks. It provides low-level operations for:- Cluster configuration and status
- Table and tablet management
- Backup and snapshot operations
- Deployment topology configuration
- Security and encryption settings
- Change data capture (CDC)
- xCluster replication
- Load balancing and decommissioning
Installation
yb-admin is located in thebin directory of YugabyteDB home.
Global Flags
—master_addresses
Comma-separated list of YB-Master hosts and ports. Default:localhost:7100
—init_master_addrs
Single YB-Master address from which other masters are discovered.—timeout_ms
RPC timeout in milliseconds. Default:60000 (1 minute)
0: Don’t wait-1: Wait indefinitely
—certs_dir_name
Directory containing certificates for secure server connections. Default:"" (empty)
Required for TLS-enabled clusters:
Online Help
Common Commands
Cluster Information
get_universe_config
Get the configuration of the universe.list_all_masters
List all YB-Master servers with their status and role.list_all_tablet_servers
List all YB-TServer nodes in the cluster.Table Operations
list_tables
List all tables in the cluster.list_tablets
List all tablets and their replica locations for a table.<keyspace-type>:ysqlorycql<keyspace-name>: Database or keyspace name<table>: Table name[max-tablets]: Maximum tablets to return (default: 10, use 0 for all)
Cluster Configuration
change_master_config
Add or remove a YB-Master server.change_config
Change the configuration of a tablet.Data Placement
modify_placement_info
Modify the placement information for a cluster.set_preferred_zones
Set preferred availability zones for leader placement.Backup and Snapshots
create_snapshot
Create a snapshot of specified tables.list_snapshots
List all snapshots.restore_snapshot
Restore from a snapshot.delete_snapshot
Delete a snapshot.export_snapshot
Export a snapshot to external storage.import_snapshot
Import a snapshot from external storage.Load Balancing
set_load_balancer_enabled
Enable or disable automatic load balancing.get_load_balancer_state
Get current state of the load balancer.Blacklisting
change_blacklist
Add or remove tablet servers from the blacklist.get_leader_blacklist
Get current leader blacklist.Encryption at Rest
add_universe_key_to_all_masters
Add encryption key to all masters.rotate_universe_key_in_memory
Rotate encryption key in memory.disable_encryption_at_rest
Disable encryption at rest.is_encryption_at_rest_enabled
Check if encryption at rest is enabled.xCluster Replication
setup_universe_replication
Setup xCluster replication between universes.delete_universe_replication
Delete xCluster replication.get_universe_replication_info
Get xCluster replication information.Change Data Capture (CDC)
create_change_data_stream
Create a CDC stream.list_change_data_streams
List all CDC streams.delete_change_data_stream
Delete a CDC stream.Leadership
master_leader_stepdown
Step down the master leader.leader_stepdown
Step down the leader for a tablet.Tablet Operations
flush_table
Flush a table (force memstore to disk).compact_table
Compact a table.Expression Syntax
Many commands use these expression formats:Namespace Expression
ycql.
Examples:
ysql.mydbycql.mykeyspacemykeyspace(assumes YCQL)
Table Expression
ysql.mydb userstableid.a1b2c3d4-e5f6-7890-abcd-ef1234567890
Index Expression
Advanced Usage Examples
Cluster Maintenance
Backup and Restore
Multi-Region Setup
TLS-Enabled Cluster
Troubleshooting
Connection Issues
Certificate Issues
Exit Status
yb-admin returns 0 on success, non-zero on failure.See Also
- yugabyted - Simplified cluster management
- yb-master - Master server configuration
- yb-tserver - Tablet server configuration
- ysqlsh - YSQL shell
- ycqlsh - YCQL shell

