| title | tiup cluster import |
|---|---|
| summary | TiUP Cluster provides the `import` command to transfer TiDB clusters from TiDB Ansible to TiUP for management. Do not use `import` for clusters with certain configurations. Use options like `--dir` and `--rename` to customize the import process. |
Before TiDB v4.0, TiDB clusters were mainly deployed using TiDB Ansible. For TiDB v4.0 and later releases, TiUP Cluster provides the import command to transfer the clusters to the tiup-cluster component for management.
Note:
- After importing the TiDB Ansible configuration to TiUP for management, DO NOT use TiDB Ansible for cluster operations anymore. Otherwise, conflicts might be caused due to inconsistent meta information.
- If the clusters deployed using TiDB Ansible are in any of the following situations, do not use the
importcommand.
- Clusters with TLS encryption enabled
- Pure KV clusters (clusters without TiDB instances)
- Clusters with Kafka enabled
- Clusters with Spark enabled
- Clusters with TiDB Lightning/TiKV Importer enabled
- Clusters still using the old
pushmode to collect monitoring metrics (if you keep the default modepullunchanged, using theimportcommand is supported)- Clusters in which the non-default ports (the ports configured in the
group_varsdirectory are compatible) are separately configured in theinventory.iniconfiguration file usingnode_exporter_port/blackbox_exporter_port- If some nodes in the cluster deployed using TiDB Ansible are deployed without monitoring components, you should first use TiDB Ansible to add the corresponding node information in the
monitored_serverssection of theinventory.inifile, and then use thedeploy.yamlplaybook to fully deploy monitoring components. Otherwise, when you perform maintenance operations after the cluster is imported into TiUP, errors might occur due to the lack of monitoring components.
tiup cluster import [flags]- Specifies the directory where TiDB Ansible is located.
- Data type:
STRING - The option is enabled by default with the current directory (the default value) passed in.
- Specifies the path of the Ansible configuration file.
- Data type:
STRING - The option is enabled by default with
. /ansible.cfg(the default value) passed in.
- Specifies the name of the Ansible inventory file.
- Data type:
STRING - The option is enabled by default with
inventory.ini(the default value) passed in.
- Controls whether to disable the backup of files in the directory where TiDB Ansible is located.
- Data type:
BOOLEAN - This option is disabled by default with the
falsevalue. After a successful import, everything in the directory specified by the-diroption is backed up to the${TIUP_HOME}/.tiup/storage/cluster/clusters/{cluster-name}/ansible-backupdirectory. If there are multiple inventory files (when multiple clusters are deployed) in this directory, it is recommended to enable this option. To enable this option, add this option to the command, and either pass thetruevalue or do not pass any value.
- Renames the imported cluster.
- Data type:
STRING - Default: NULL. If this option is not specified in the command, the cluster_name specified in inventory is used as the cluster name.
- Prints the help information.
- Data type:
BOOLEAN - This option is disabled by default with the
falsevalue. To enable this option, add this option to the command, and either pass thetruevalue or do not pass any value.
Shows the logs of the import process.