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:

  1. 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:

  1. tiup --version

Overview - 图1

Note

For TiUP versions starting from v1.11.3, the telemetry is disabled by default in newly deployed TiUP, and usage information is not collected and shared with PingCAP. For details about what is shared and how to disable the sharing, see Telemetry.

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:

  1. tiup --help
  1. TiUP is a command-line component management tool that can help to download and install
  2. TiDB platform components to the local system. You can run a specific version of a component via
  3. "tiup <component>[:version]". If no version number is specified, the latest version installed
  4. locally will be used. If the specified component does not have any version installed locally,
  5. the latest stable version will be downloaded from the repository.
  6. Usage:
  7. tiup [flags] <command> [args...]
  8. tiup [flags] <component> [args...]
  9. Available Commands:
  10. install Install a specific version of a component
  11. list List the available TiDB components or versions
  12. uninstall Uninstall components or versions of a component
  13. update Update tiup components to the latest version
  14. status List the status of instantiated components
  15. clean Clean the data of instantiated components
  16. mirror Manage a repository mirror for TiUP components
  17. help Help about any command or component
  18. Components Manifest:
  19. use "tiup list" to fetch the latest components manifest
  20. Flags:
  21. --binary <component>[:version] Print binary path of a specific version of a component <component>[:version]
  22. and the latest version installed will be selected if no version specified
  23. --binpath string Specify the binary path of component instance
  24. -h, --help help for tiup
  25. -T, --tag string Specify a tag for component instance
  26. -v, --version version for tiup
  27. Component instances with the same "tag" will share a data directory ($TIUP_HOME/data/$tag):
  28. $ tiup --tag mycluster playground
  29. Examples:
  30. $ tiup playground # Quick start
  31. $ tiup playground nightly # Start a playground with the latest nightly version
  32. $ tiup install <component>[:version] # Install a component of specific version
  33. $ tiup update --all # Update all installed components to the latest version
  34. $ tiup update --nightly # Update all installed components to the nightly version
  35. $ tiup update --self # Update the "tiup" to the latest version
  36. $ tiup list # Fetch the latest supported components list
  37. $ tiup status # Display all running/terminated instances
  38. $ tiup clean <name> # Clean the data of running/terminated instance (Kill process if it's running)
  39. $ tiup clean --all # Clean the data of all running/terminated instances
  40. 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 components
    • list: used to view the list of available components
    • uninstall: used to uninstall components
    • 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
    • help: used to print out help information
  • Available components
    • playground: used to start a TiDB cluster locally
    • client: used to connect to a TiDB cluster in a local machine
    • cluster: used to deploy a TiDB cluster for production environments
    • bench: used to stress test the database

Overview - 图2

Note

  • The number of available components will continue to grow. To check the latest supported components, execute the tiup list command.
  • The list of available versions of components will also continue to grow. To check the latest supported component versions, execute the tiup list <component> command.

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.