Implement a mode option to switch default set of TiUP, especially for tikv-slim mode

Hi here, I just create a pull request to TiUP implementing my previous proposed feature “fruitful playground”.

It introduces a new options name mode with which you can switch the default value set among tidb mode or tikv-slim mode.

For details, in tidb mode, which is the default mode, default value set as

--db 1               // 1 TiDB instance
--kv 1               // 1 TiKV instance
--pd 1               // 1 PD instance
--tiflash 1          // 1 TiFlash instance
--db.timeout 60      // TiDB max wait time in seconds for starting
--tiflash.timeout 60 // TiFlash max wait time in seconds for starting
--host 127.0.0.1     // Playground cluster host
--monitor true       // Start prometheus and grafana component 

and in tikv-slim, tidb and tiflash instance are excluded

--kv 1               // 1 TiKV instance
--pd 1               // 1 PD instance
--host 127.0.0.1     // Playground cluster host
--monitor true       // Start prometheus and grafana component 

In short, you can now use

tiup playground --mode tikv-slim

to run a tikv only cluster and populate other options gradually.

I’ll appreciate if you help review the pull request, test the patch locally, or comment with any feedback :slight_smile:

1 Like