TiDB version 5.4: Using TiDB's built-in backup to back up data to Alibaba Cloud OSS results in a 403 error. Can TiDB back up to Alibaba Cloud OSS?

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

Original topic: tidb5.4版本,使用tidb自带的backup备份数据至阿里云oss中,提示403错误。tidb是否可以备份到阿里云oss中。

| username: jerome

[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version]
[Reproduction Path] What operations were performed to encounter the issue
Created a secret for accessing Alibaba Cloud OSS (tidb-bk-oss-secret), created a secret for accessing TiDB (tidb-bk-secret), and created a backup (backup-cl_crm_data-bk.yaml). The status of the created backup pod is error, and checking the logs shows a 403 Forbidden error.
[Encountered Issue: Phenomenon and Impact]

cat backup-cl_crm_data-bk.yaml

apiVersion: pingcap.com/v1alpha1
kind: Backup
metadata:
  name: backup-cl-crm-data
  namespace: tidb-backup
spec:
  backupType: full
  from:
    host: basic-tidb.tidb-cluster.svc.cluster.local
    port: 4000
    user: root
    secretName: tidb-bk-secret
  s3:
    provider: s3
    secretName: tidb-bk-oss-secret
    endpoint: oss-cn-....yuncs.com
    bucket: ecow....-backup
    options:
    - --ignore-checksum
  dumpling:
    options:
    - --threads=8
    - --rows=20000
    - --compress=gzip
    - --loglevel=debug
    - --params="tidb_enable_chunk_rpc=0"
    tableFilter:
    - "cl....data.*"
  storageClassName: alic...-sp
  storageSize: 10Gi
NAME                              READY   STATUS   RESTARTS   AGE
backup-backup-cl-crm-data-fgs96   0/1     Error    0          31m

NAME                 STATUS   BACKUPPATH                                                        BACKUPSIZE   COMMITTS   AGE
backup-cl-crm-data   Failed   s3://ecoweather-pro-tidb-backup/backup-2023-02-14T09:56:29Z.tgz                           31m

[Resource Configuration]
[Attachment: Screenshot/Logs/Monitoring]
backup-backup-cl-crm-data.log (4.2 KB)

| username: Billmay表妹 | Original post link

Isn’t backup done using BR?

| username: jerome | Original post link

Using dumping backup, backed up to Alibaba Cloud OSS.

| username: yiduoyunQ | Original post link

403 indicates that the AK/SK is incorrect, you can check it first. secretName: tidb-bk-oss-secret essentially sets the corresponding AK/SK to the ENV of the BK pod. Refer to the Dumpling documentation Export to Amazon S3. If I remember correctly, you can describe the pod to see the corresponding ENV for confirmation.

| username: jerome | Original post link

The AK/SK are both correct, and uploading works fine using Python and Java. Could you please provide an example of using Dumpling to back up to Alibaba Cloud OSS?

| username: 小王同学Plus | Original post link

Refer to this document: 使用 Dumpling 备份 TiDB 集群数据到兼容 S3 的存储 | PingCAP 文档中心

| username: system | Original post link

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