After shutting down and relocating the TiDB cluster, it cannot be started. Is there a way to directly use the TiKV data to start the database if the data is intact?

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

Original topic: TiDB集群关闭搬迁之后无法启动,TiKV数据完整是否有方法直接使用该DB数据启动

| username: zhengjunbo

[TiDB Usage Environment] Production Environment
[TiDB Version] V4.0.15
[Reproduction Path] Deployed a cluster on a server, shut down the server, moved and modified the IP, and couldn’t start it. Is it possible to directly use the data in TiKV to start (even if it’s damaged, it’s different from the original disaster recovery)?
[Encountered Problem: Problem Phenomenon and Impact] Want to read the data inside, but moving only the db data from TiKV to the new cluster reports
[“failed to start node: "[src/server/node.rs:207]: cluster ID mismatch, local 7085723406752337168 != remote 7201033680923810856, you are trying to connect to another cluster, please reconnect to the correct PD"”]

| username: TiDBer_jYQINSnf | Original post link

Move the PD over as well. The problem now is that you used a new PD, right? Then when TiKV connects to PD, it results in a cluster ID mismatch.

| username: dba-kit | Original post link

Essentially, you still need to change the IP. You can follow this SOP to fix the PD data.

| username: TiDBer_jYQINSnf | Original post link

Master Zhang is indeed knowledgeable :smile:
If TiDB cannot change the IP, you can configure it as a host and set it up with a domain name. This way, you won’t have to worry about changing the IP.

| username: zhengjunbo | Original post link

The original PD has been modified. I am now taking over to handle it.

[2023/02/17 17:29:51.582 +08:00] [WARN] [client.rs:106] [“validate PD endpoints failed”] [err=“Other("[components/pd_client/src/util.rs:443]: PD response cluster_id mismatch, want 7201051794948305004, got 7085723406752337168")”]

| username: zhengjunbo | Original post link

Got it, thanks. Just move the last_tikv.toml out of the tikv directory.

| username: zhengjunbo | Original post link

However, if all data is lost and only one TiKV remains, is there a way to recover it? Even if it’s lossy, it’s fine.

| username: dba-kit | Original post link

I haven’t encountered this scenario yet, but you can refer to the official documentation on online unsafe recovery: Online Unsafe Recovery 使用文档 | PingCAP 文档中心

| username: TI表弟 | Original post link

Zhang Tianshi is everywhere.

| username: dba-kit | Original post link

Hurry up and accumulate points to exchange for a charger as soon as possible.

| username: system | Original post link

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