How to Backup KV Data with BR

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: br怎么备份kv数据

| username: TiDBer_mHZrDnWq

[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path]
[Encountered Problem: Problem Phenomenon and Impact] The environment only runs PD and TiKV, serving as a KV service. An error occurs when using ./br backup full --pd “core0:4379” --storage “s3://backup-data/”
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachment: Screenshot/Log/Monitoring]

| username: jiayou64 | Original post link

View cluster information
tiup cluster display
Backup parameters:

  • --pd: PD access address option. "${PD_IP}:2379" is the parameter value for --pd.
| username: tidb菜鸟一只 | Original post link

Didn’t you use the tidb-server node?

| username: Jellybean | Original post link

iKV can operate independently of TiDB and form a KV database with PD, in which case the product form is RawKV. The TiKV-BR tool supports backup and recovery for products using RawKV. To back up cluster Raw mode data:

export AWS_ACCESS_KEY_ID=&{AWS_KEY_ID};
export AWS_SECRET_ACCESS_KEY=&{AWS_KEY};
tikv-br backup raw \
    --pd="&{PDIP}:2379" \
    --storage="s3://backup-data/2022-09-16/" \
    --dst-api-version v2 \
    --log-file="/tmp/backupraw.log \
    --gcttl=5m \
    --start="a" \
    --end="z" \
    --format="raw"

For more details, refer to: TiKV | RawKV BR 使用手册

| username: zhaokede | Original post link

'mysql.tidb’ doesn’t exist. Does Raw mode not have these?

| username: 小龙虾爱大龙虾 | Original post link

Correct, raw kv is a separate backup.