diff --git a/components/playground/main.go b/components/playground/main.go index 2a984afd71..09ce160f2c 100644 --- a/components/playground/main.go +++ b/components/playground/main.go @@ -122,6 +122,7 @@ Examples: $ tiup playground nightly --without-monitor # Start a local cluster and disable monitor system $ tiup playground --pd.config ~/config/pd.toml # Start a local cluster with specified configuration file $ tiup playground --db.binpath /xx/tidb-server # Start a local cluster with component binary path + $ tiup playground --tag xx # Start a local cluster with data dir named 'xx' and uncleaned after exit $ tiup playground --mode tikv-slim # Start a local tikv only cluster (No TiDB or TiFlash Available) $ tiup playground --mode tikv-slim --kv 3 --pd 3 # Start a local tikv only cluster with 6 nodes`, SilenceUsage: true, @@ -278,7 +279,7 @@ Note: Version constraint [bold]%s[reset] is resolved to [green][bold]%s[reset]. rootCmd.Flags().StringVar(&options.Mode, "mode", "tidb", "TiUP playground mode: 'tidb', 'tidb-cse', 'tikv-slim'") rootCmd.Flags().StringVar(&options.PDMode, "pd.mode", "pd", "PD mode: 'pd', 'ms'") - rootCmd.PersistentFlags().StringVarP(&tag, "tag", "T", "", "Specify a tag for playground") // Use `PersistentFlags()` to make it available to subcommands. + rootCmd.PersistentFlags().StringVarP(&tag, "tag", "T", "", "Specify a tag for playground, data dir of this tag will not be removed after exit") rootCmd.Flags().Bool("without-monitor", false, "Don't start prometheus and grafana component") rootCmd.Flags().BoolVar(&options.Monitor, "monitor", true, "Start prometheus and grafana component") _ = rootCmd.Flags().MarkDeprecated("monitor", "Please use --without-monitor to control whether to disable monitor.") diff --git a/components/playground/playground.go b/components/playground/playground.go index 569b3b55a4..1522626ef6 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -1251,6 +1251,9 @@ func (p *Playground) bootCluster(ctx context.Context, env *environment.Environme p.tiflashs = started p.waitAllTiFlashUp() + fmt.Println() + color.New(color.FgYellow, color.Bold).Println("TiDB Playground Cluster will delete all data of the cluster after exit. Please use --tag xx to pin the data dir.") + fmt.Println() color.New(color.FgGreen, color.Bold).Println("🎉 TiDB Playground Cluster is started, enjoy!") fmt.Println() diff --git a/doc/user/playground.md b/doc/user/playground.md index ff3d68ca06..4f8dfe80b1 100644 --- a/doc/user/playground.md +++ b/doc/user/playground.md @@ -55,7 +55,7 @@ Flags: --pump int Pump instance number --pump.binpath string Pump instance binary path --pump.config string Pump instance configuration file - -T, --tag string Specify a tag for playground + -T, --tag string Specify a tag for playground, data dir of this tag will not be removed after exit --ticdc int TiCDC instance number --ticdc.binpath string TiCDC instance binary path --ticdc.config string TiCDC instance configuration file