Sign InTry Free

TiUP Overview

Starting with TiDB 4.0, TiUP, as the package manager, makes it far easier to manage different cluster components in the TiDB ecosystem. Now you can run any component with only a single line of TiUP commands.

Install TiUP

You can install TiUP with a single command in both Darwin and Linux operating systems:

curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

This command installs TiUP in the $HOME/.tiup folder. The installed components and the data generated by their operation are also placed in this folder. This command also automatically adds $HOME/.tiup/bin to the PATH environment variable in the Shell .profile file, so you can use TiUP directly.

After installation, you can check the version of TiUP:

tiup --version
1.14.0 tiup Go Version: go1.21.4 Git Ref: v1.14.0 GitHash: c3e9fc518aea0da66a37f82ee5a516171de9c372

TiUP ecosystem introduction

TiUP is not only a package manager in the TiDB ecosystem. Its ultimate mission is to enable everyone to use TiDB ecosystem tools easier than ever before by building its own ecosystem. This requires introducing additional packages to enrich the TiUP ecosystem.

This series of TiUP documents introduce what these packages do and how you can use them.

In the TiUP ecosystem, you can get help information by adding --help to any command, such as the following command to get help information for TiUP itself:

tiup --help
TiUP is a command-line component management tool that can help to download and install TiDB platform components to the local system. You can run a specific version of a component via "tiup [:version]". If no version number is specified, the latest version installed locally will be used. If the specified component does not have any version installed locally, the latest stable version will be downloaded from the repository. Usage: tiup [flags] [args...] tiup [flags] [args...] tiup [command] Examples: $ tiup playground # Quick start $ tiup playground nightly # Start a playground with the latest nightly version $ tiup install [:version] # Install a component of specific version $ tiup update --all # Update all installed components to the latest version $ tiup update --nightly # Update all installed components to the nightly version $ tiup update --self # Update the "tiup" to the latest version $ tiup list # Fetch the latest supported components list $ tiup status # Display all running/terminated instances $ tiup clean # Clean the data of running/terminated instance (Kill process if it's running) $ tiup clean --all # Clean the data of all running/terminated instances Available Commands: install Install a specific version of a component list List the available TiDB components or versions uninstall Uninstall components or versions of a component update Update tiup components to the latest version status List the status of instantiated components clean Clean the data of instantiated components mirror Manage a repository mirror for TiUP components telemetry Controls things about telemetry env Show the list of system environment variable that related to TiUP history Display the historical execution record of TiUP, displays 100 lines by default link Link component binary to $TIUP_HOME/bin/ unlink Unlink component binary to $TIUP_HOME/bin/ help Help about any command completion Generate the autocompletion script for the specified shell Flags: --binary [:version] Print binary path of a specific version of a component [:version] and the latest version installed will be selected if no version specified --binpath string Specify the binary path of component instance -h, --help help for tiup -T, --tag string [Deprecated] Specify a tag for component instance -v, --version Print the version of tiup Use "tiup [command] --help" for more information about a command.

The output is long but you can focus on only two parts:

  • Available commands
    • install: used to install a specific version of a component
    • list: used to view the list of available TiDB components or available versions of a component
    • uninstall: used to uninstall components or versions of a component
    • update: used to update the component version
    • status: used to view the running history of components
    • clean: used to clear the running log of components
    • mirror: used to clone a private mirror from the official mirror
    • telemetry: used to control the telemetry feature
    • env: used to show the list of system environment variables that related to TiUP
    • history: used to display the historical execution record of TiUP (100 lines by default)
    • link: used to link component binary to $TIUP_HOME/bin/
    • unlink: used to unlink component binary to $TIUP_HOME/bin/
    • help: used to print out help information
    • completion: used to generate the command line autocompletion script for the specified shell (including bash, zsh, fish, and powershell)
  • Available components
    • playground: used to start a TiDB cluster locally
    • client: client used to connect to TiUP Playground
    • cluster: used to deploy a TiDB cluster for production environments
    • bench: used to stress test the database

TiUP commands are implemented in TiUP's internal code and used for package management operations, while TiUP components are independent component packages installed by TiUP commands.

For example, if you run the tiup list command, TiUP directly runs its own internal code; if you run the tiup playground command, TiUP first checks whether there is a local package named "playground", and if not, TiUP downloads the package from the mirror, and then run it.

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
Playground
New
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
Products
TiDB
TiDB Dedicated
TiDB Serverless
Pricing
Get Demo
Get Started
© 2024 PingCAP. All Rights Reserved.
Privacy Policy.