How to Use BR to Back Up KV Stored in TiKV

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

Original topic: 如何使用BR备份tikv中存储的kv

| username: Hacker_8fNHonIE

[TiDB Usage Environment] Test environment
[TiDB Version] 4.0.13
[Reproduction Path]

  1. Create a TiKV 4.0.13 three-node cluster
  2. Write KV
  3. Use tikv-ctl to query, found a total of 5 KVs
  4. Use BR for backup
  5. No information was backed up.
    [Encountered Problem: Problem Phenomenon and Impact]
    How can I back up the KVs I wrote?
    [Resource Configuration]
    [Attachment: Screenshot/Log/Monitoring]
    Queried KV information

    Backup using BR full

    Check the log, no information was backed up
| username: zhanggame1 | Original post link

How exactly is writing to KV done?

| username: Hacker_8fNHonIE | Original post link

I called the tikv-client and wrote a binary file. I also used br raw for backup. I followed the scan method and used --start ‘’ but couldn’t back up. If I want to perform a full backup, how should I use br raw?

| username: Hacker_8fNHonIE | Original post link

The default value of the tidb_gc_life_time parameter is 10m, which means that data older than 10 minutes will be cleaned up.

| username: tidb菜鸟一只 | Original post link

Have you tried using the RawKV BR tool?
TiKV | RawKV BR User Manual

| username: Hacker_8fNHonIE | Original post link

Verify step:
Download tikv-br 1.1.0

  1. Create a three-node TiKV 4.0.13 cluster

  2. Write 5 key-value pairs

  3. Use tikv-br for backup
    Use --check-requirements=false to ignore version


    Backup successful

  4. Uninstall the three-node cluster and redeploy a new one

  5. Copy the SST files from the leader node to all nodes

  6. Perform recovery

  7. Stop the service and use tikv-ctl to query

Recovery successful

Thank you!

| username: redgame | Original post link

Impressive.

| username: Hacker_8fNHonIE | Original post link

Hello, I have another question. Suppose I have already backed up the KV data… and the store IDs of my original TiKV backup were 1, 4, and 5. My original TiKV has been completely lost, and the newly added TiKV has store IDs 1001, 1002, and 1003. How should I restore in this situation?

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.