# Clean Up Cluster Data

__*TiDB cleans up cluster data*__
__*tiup cluster clean*__

+ After starting the cluster, we can clean the cluster data with the following command:
  + `tiup cluster clean ${cluster-name} --xxx`
  + —log: Clean up logs
  + —data: clean up data
  + —all: clean logs and data

-------------------------------------------------------------
This operation shuts down all services and empties their data directories or/and logs directories, and cannot be recover, and requires caution.

Erase the data of all services in the cluster, but keep the logs:
tiup cluster clean $ {cluster-name} —data

To empty the logs of all services in the cluster, but keep the data:
tiup cluster clean $ {cluster-name} —log

To empty the data and logs of all services in the cluster:
tiup cluster clean $ {cluster-name} —all

Clear logs and data for all services other than Prometheus: (Optional)
tiup cluster clean $ {cluster-name} —all —ignore-role prometheus

Empty logs and data for all services except node 172.16.13. 11:9000: (optional)
tiup cluster clean $ {cluster-name} —all —ignore-node 172.16.13.11:9000

Purge logs and data for all services deployed other than 172.16.13.12: (Optional)
tiup cluster clean $ {cluster-name} —all —ignore-node 172.16.13.12