RAID卡无电池,导致数据丢失,如何恢复?

【 TiDB 使用环境】
【概述】场景+问题概述
生产环境,两台主机组成的集群,一台机部分数据丢失
要怎么做才能最大程度的恢复数据?
【背景】做过哪些操作
tidb服务无法启动,pd可以启动,tikv一台能启动一台不能启动
【现象】业务和数据库现象
【业务影响】
【TiDB 版本】
V4.0.11
【附件】

  1. TiUP Cluster Display 信息
    [tidb@crm-dc-13 ~]$ tiup cluster display test-cluster
    Found cluster newer version:

    The latest version: v1.5.6
    Local installed version: v1.4.1
    Update current component: tiup update cluster
    Update all components: tiup update --all

Starting component cluster: /home/tidb/.tiup/components/cluster/v1.4.1/tiup-cluster display test-cluster
Cluster type: tidb
Cluster name: test-cluster
Cluster version: v4.0.11
SSH type: builtin
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir


200.100.1.13:9093 alertmanager 200.100.1.13 9093/9094 linux/x86_64 inactive /tidbdata/deploy/data.alertmanager /tidbdata/deploy
200.100.1.13:3000 grafana 200.100.1.13 3000 linux/x86_64 inactive - /tidbdata/deploy
200.100.1.13:2379 pd 200.100.1.13 2379/2380 linux/x86_64 Down /tidbdata/deploy/data.pd /tidbdata/deploy
200.100.1.17:2379 pd 200.100.1.17 2379/2380 linux/x86_64 Down /tidbdata/deploy/pd-2379/data /tidbdata/deploy/pd-2379
200.100.1.13:9090 prometheus 200.100.1.13 9090 linux/x86_64 inactive /tidbdata/deploy/prometheus2.0.0.data.metrics /tidbdata/deploy
200.100.1.17:9090 prometheus 200.100.1.17 9090 linux/x86_64 inactive /tidbdata/deploy/prometheus-9090/data /tidbdata/deploy/prometheus-9090
200.100.1.13:4000 tidb 200.100.1.13 4000/10080 linux/x86_64 Down - /tidbdata/deploy
200.100.1.17:4000 tidb 200.100.1.17 4000/10080 linux/x86_64 Down - /tidbdata/deploy/tidb-4000
200.100.1.17:9000 tiflash 200.100.1.17 9000/8123/3930/20170/20292/8234 linux/x86_64 N/A /tidbdata/deploy/tiflash-9000/data /tidbdata/deploy/tiflash-9000
200.100.1.13:20160 tikv 200.100.1.13 20160/20180 linux/x86_64 N/A /tidbdata/deploy/data /tidbdata/deploy
200.100.1.17:20160 tikv 200.100.1.17 20160/20180 linux/x86_64 N/A /tidbdata/deploy/tikv-20160/data /tidbdata/deploy/tikv-20160
Total nodes: 11

  1. TiUP Cluster Edit Config 信息

  2. TiDB- Overview 监控

  • 对应模块日志(包含问题前后1小时日志)
1 个赞

麻烦发一下 tiup display 的结果结果。

tiup cluster display test-cluster
的结果在一楼有

现在集群拓扑是什么样的 ?单个物理机上面什么拓扑配置 ?

两台机均包含tidb、pd、tikv
您是想要这个?http://ip:2379/dashboard/#/cluster_info/instance,tidb不能启动,不能访问dashboard

Hi,这套集群因为是 2 个 TiKV 实例,虽然部署设置了 3 副本,但是实际每个 raft group 是 2 副本。现在相当于丢失 1 副本,剩 1 副本无法提供服务。可以通过 unsafe recover 工具做一下数据恢复。另外建议扩容一台 tikv 节点,这样 3 副本,至少容灾 1 副本。具体操作可以参考一下下面的 SOP 的操作。

2 个赞

看了下日志,只要把这几个文件处理下应该就能启动了,通过SST如何查到对应的 Region id?
[2021/09/15 16:51:03.002 +08:00] [FATAL] [server.rs:357] [“failed to create kv engine: RocksDb Corruption: Can’t access /1562650.sst: IO error: No such file or directorywhile stat a file for size: /tidbdata/deploy/tikv-20160/data/db/1562650.sst: No such file or directory\ Can’t access /1562652.sst: IO error: No such file or directorywhile stat a file for size: /tidbdata/deploy/tikv-20160/data/db/1562652.sst: No such file or directory\ Can’t access /1562654.sst: IO error: No such file or directorywhile stat a file for size: /tidbdata/deploy/tikv-20160/data/db/1562654.sst: No such file or directory\ Can’t access /1562655.sst: IO error: No such file or directorywhile stat a file for size: /tidbdata/deploy/tikv-20160/data/db/1562655.sst: No such file or directory\ Can’t access /1562651.sst: IO error: No such file or directorywhile stat a file for size: /tidbdata/deploy/tikv-20160/data/db/1562651.sst: No such file or directory\ Can’t access /1562653.sst: IO error: No such file or directorywhile stat a file for size: /tidbdata/deploy/tikv-20160/data/db/1562653.sst: No such file or directory\ ”]

这块不太好找,可以看一下 tikv-ctl 工具看看。

此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。