Project: YugabyteDB (App Definition and Development / Database)
File: yb-ts-cli.md

title: yb-ts-cli - command line tool for advanced yb-tserver operations headerTitle: yb-ts-cli linkTitle: yb-ts-cli description: Use the yb-ts-cli command line utility to perform advanced YB-TServer operations. menu: v2.18: identifier: yb-ts-cli parent: admin weight: 50 type: docs `yb-ts-cli` is a command line tool that can be used to perform an operation on a particular tablet server (`yb-tserver`). Some of the commands perform operations similar to . The `yb-admin` commands focus on cluster administration, the `yb-ts-cli` commands apply to specific YB-TServer nodes. `yb-ts-cli` is a binary file installed with YugabyteDB and is located in the `bin` directory of the YugabyteDB home directory. ```sh yb-ts-cli [ --server_address=<host>:<port> ] <command> <flags> ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. command*: The operation to be performed. See below. flags*: The flags to be applied to the command. See . To display the available online help, run `yb-ts-cli` without any commands or flags at the YugabyteDB home directory. ```sh ./bin/yb-ts-cli ``` The following commands are available: If all tablets are running, returns "All tablets are running". Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] aretablets_running ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Prints the number of tablets that have not yet bootstrapped. If all tablets have bootstrapped, returns "Tablet server is ready". Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] isserver_ready ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Compact all tablets on the tablet server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] compactall_tablets ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Compact the specified tablet on the tablet server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] compacttablet <tablet_id> ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. tablet_id*: The identifier of the tablet to compact. Print the count of uncommitted intents (or ). Useful for debugging transactional workloads. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] countintents ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Prints the value of the current . Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] currenthybrid_time ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Deletes the tablet with the specified tablet ID (`tablet_id`) and reason. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] deletetablet <tablet_id> "<reason-string>" ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. tablet_id*: The identifier (ID) for the

reason-string*: Text string providing useful information on why the tablet was deleted. Dump, or export, the specified tablet ID (`tablet_id`). Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] dumptablet <tablet_id> ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. tablet_id*: The identifier (ID) for the tablet. Flush all tablets on the tablet server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] flushall_tablets ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Flush the specified tablet on the tablet server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] flushtablet <tablet_id> ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. tablet_id*: The identifier of the tablet to compact. Lists the tablets on the specified tablet server, displaying the following properties: column name, tablet ID, state, table name, shard, and schema. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] listtablets ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. Trigger a reload of TLS certificates and private keys from disk on the specified (master or tablet) server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] reloadcertificates ``` host:port: The host and port* of the master or tablet server. Default is `localhost:9100`. Trigger a remote bootstrap of a tablet from another tablet server to the specified tablet server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] remotebootstrap <sourcehost> <tabletid> ``` host:port: The host and port* of the tablet server running the remote bootstrap. Default is `localhost:9100`. source_host: The host or host and port* of the tablet server to bootstrap from. tablet_id*: The identifier of the tablet to trigger a remote bootstrap for. See for example usage. Sets the specified configuration flag for the tablet server. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] setflag [ --force ] <flag> <value> ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. `--force`: Flag to allow a change to a flag that is not explicitly marked as runtime-settable. Note that the change may be ignored on the server or may cause the server to crash, if unsafe values are provided. See . flag*: The `yb-tserver` configuration flag (without the `--` prefix) to be set. See value*: The value to be applied. {{< note title="Important" >}} The `set_flag` command changes the in-memory value of the specified flag, atomically, for a running server and can alter its behavior. The change does NOT persist across

In practice, there are some flags that are runtime safe to change (runtime-settable) and some that are not. For example, the bind address of the server cannot be changed at runtime, since the server binds just once at startup. While most of the flags are probably runtime-settable, you need to review the flags and note in the configuration pages which flags are not runtime-settable. (See GitHub issue ). One typical operational flow is that you can use this to modify runtime flags in memory and then out of band also modify the configuration file that the server uses to start. This allows for flags to be changed on running servers, without executing a restart of the server. {{< /note >}} Prints the status of the tablet server, including information on the node instance, bound RPC addresses, bound HTTP addresses, and version information. Syntax ```sh yb-ts-cli [ --server_address=<host>:<port> ] status ``` host:port: The host and port* of the tablet server. Default is `localhost:9100`. For an example, see Refresh flags that are loaded from the configuration file. Works on both YB-Master (port 9100) and YB-TServer (port 7100) process. No parameters needed. Each process needs to have the following command issued, for example, issuing the command on one YB-TServer won't update the flags on the other YB-TServers. Syntax ```sh yb-ts-cli [ --serveraddress=<host>:<port> ] refreshflags ``` host:port: The host and port* of the YB-Master or YB-TServer. Default is `localhost:9100`. The following flags can be used, when specified, with the commands above. Use this flag with the command to allow a change to a flag that is not explicitly marked as runtime-settable. Note that the change may be ignored on the server or may cause the server to crash, if unsafe values are provided. Default: `false` The address (host and port) of the tablet server to run against. Default: `localhost:9100` The duration, in milliseconds (ms), before the RPC request times out. Default: `60000` (1000 ms = 1 sec) To connect to a cluster with TLS enabled, you must include the `--certsdirname` flag with the directory location where the root certificate is located. Default: `""` ```sh ./bin/yb-ts-cli --serveraddress=127.0.0.1 --certsdir_name="/path/to/dir/name" status ``` ```output node_instance { permanent_uuid: "237678d61086489991080bdfc68a28db" instance_seqno: 1579278624770505 } boundrpcaddresses { host: "127.0.0.1" port: 9100 } boundhttpaddresses { host: "127.0.0.1" port: 9000 } version_info { git_hash: "83610e77c7659c7587bc0c8aea76db47ff8e2df1" build_hostname: "yb-macmini-6.dev.yugabyte.com" build_timestamp: "06 Jan 2020 17:47:22 PST" build_username: "jenkins" buildcleanrepo: true build_id: "743" build_type: "RELEASE" version_number: "2.0.10.0" build_number: "4" } ``` ```sh ./bin/yb-ts-cli --serveraddress=yb-tserver-1:9100 currenthybrid_time ``` ```output 6470519323472437248 ```