- If TTL is not used, the data written to TiKV will always exist in TiKV unless it is manually deleted.
Before you start, ensure that you have installed TiUP and jshell, and have downloaded the JARS file according to TiKV in 5 Minutes.
TTL is disabled by default. To enable it, create a file tikv.yaml
using the following configuration.
Show TiUP version:
tiup -v
version >= 1.5.2:
tiup playground --kv.config tikv.yaml
The following example shows how to verify the TTL works.
Save the following script to file test_raw_ttl.java
.
[key: "k1"
, key: "k2"
value: "v2"
Sleep 30 seconds.
[key: "k2"
]