Skip to content

Backup failed using the minio storage #869

@limboys

Description

@limboys

minio s3 bucket no working in backup

operator version: v0.6.2

mysqlbackup.yaml

apiVersion: v1
kind: Secret
metadata:
  name: mysql-cluster-backup-secret
  namespace: mysql-operator
type: Opaque
data:
  S3_PROVIDER: QVdT
  AWS_ACCESS_KEY_ID: a0tJWnhsS2VIOFdzM2ZaSA==
  AWS_SECRET_ACCESS_KEY: WjNPaTVlTDhuVGVkODl2bUhRT1I4bFA2cFNzQmdhRnA=
  AWS_REGION: dXMtZWFzdC0x
  S3_ENDPOINT: aHR0cDovL21pbmlvLm15c3FsLW9wZXJhdG9yLnN2Yw== #http://minio.mysql-operator.svc

mysql-cluster.yaml

apiVersion: mysql.presslabs.org/v1alpha1
kind: MysqlCluster
metadata:
  name: my-cluster
  namespace: mysql-operator
spec:
  replicas: 3
  secretName: mysql-password-secret

  ## For recurrent backups set backupSchedule with a cronjob expression with seconds
  backupSchedule: "0 0 0 * * *" # daily
  backupURL: s3://mysql-backup
  backupSecretName: mysql-cluster-backup-secret
  backupScheduleJobsHistoryLimit: 2
  backupRemoteDeletePolicy: delete
...

backup job log

[root@k8s1201 mysql]# kubectl logs my-cluster-backup-backup-bwgn4 -n mysql-operator
Create Google Drive service-account.json file.
Create rclone.conf file.
I0130 02:22:58.459583       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="MY_SERVER_ID_OFFSET"
I0130 02:22:58.460099       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="MY_MYSQL_VERSION"
I0130 02:22:58.460115       1 deleg.go:130] sidecar "msg"="MY_MYSQL_VERSION is not a semver version"  
I0130 02:22:58.460130       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="MY_CLUSTER_NAME"
I0130 02:22:58.460145       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="MY_NAMESPACE"
I0130 02:22:58.460166       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="MY_SERVICE_NAME"
I0130 02:22:58.460180       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="INIT_BUCKET_URI"
I0130 02:22:58.460195       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="OPERATOR_USER"
I0130 02:22:58.460218       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="OPERATOR_PASSWORD"
I0130 02:22:58.460238       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="REPLICATION_USER"
I0130 02:22:58.460262       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="REPLICATION_PASSWORD"
I0130 02:22:58.460280       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="METRICS_EXPORTER_USER"
I0130 02:22:58.460297       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="METRICS_EXPORTER_PASSWORD"
I0130 02:22:58.460313       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="ORC_TOPOLOGY_USER"
I0130 02:22:58.460329       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="ORC_TOPOLOGY_PASSWORD"
I0130 02:22:58.460351       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="BACKUP_COMPRESS_COMMAND"
I0130 02:22:58.460378       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="BACKUP_DECOMPRESS_COMMAND"
I0130 02:22:58.460403       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="RCLONE_EXTRA_ARGS"
I0130 02:22:58.460421       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="XBSTREAM_EXTRA_ARGS"
I0130 02:22:58.460438       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="XTRABACKUP_EXTRA_ARGS"
I0130 02:22:58.460464       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="XTRABACKUP_PREPARE_EXTRA_ARGS"
I0130 02:22:58.460481       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="XTRABACKUP_TARGET_DIR"
I0130 02:22:58.460497       1 deleg.go:130] sidecar "msg"="environment is not set"  "key"="INITFILE_EXTRA_SQL"
I0130 02:22:58.460770       1 deleg.go:130] sidecar "msg"="take a backup"  "bucket"="s3://mysql-backup/my-cluster-backup.xbackup.gz" "host"="my-cluster-mysql-1.mysql.mysql-operator"
I0130 02:22:58.460821       1 deleg.go:130] sidecar "msg"="initialize a backup"  "endpoint"="/xbackup" "host"="my-cluster-mysql-1.mysql.mysql-operator"
2023/01/30 02:23:01 NOTICE: S3 bucket mysql-backup: Streaming uploads using chunk size 5Mi will have maximum file size of 48.828Gi
2023/01/30 02:23:47 ERROR : my-cluster-backup.xbackup.gz.tmp: Post request rcat error: multipart upload failed to initialise: RequestError: send request failed
caused by: Post "http://mysql-backup.minio.mysql-operator.svc/my-cluster-backup.xbackup.gz.tmp?uploads=": dial tcp: lookup mysql-backup.minio.mysql-operator.svc on 10.96.0.10:53: no such host
2023/01/30 02:23:47 Failed to rcat with 2 errors: last error was: multipart upload failed to initialise: RequestError: send request failed
caused by: Post "**http://mysql-backup.minio.mysql-operator.svc**/my-cluster-backup.xbackup.gz.tmp?uploads=": dial tcp: lookup mysql-backup.minio.mysql-operator.svc on 10.96.0.10:53: no such host
E0130 02:23:47.841354       1 deleg.go:144] sidecar "msg"="take backup command failed" "error"="exit status 1"

The dns resolution error was reported in the log, and the request path was found to be mysql-backup.minio.mysql-operator.svc, so the host resolution could not be found, but the endpoint configured in the secret was minio.mysql-operator.svc. So why is mysql-backup automatically prefixed (seems to be the bucket name)?

The problem is the same as #771, which has been solution? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions