cockroachdb Daily backup from EKS cluster

1/30/2022

I need to take daily backup for cockroachdb and push to S3 , its running under EKS cluster with statefulset, So can anyone suggest the best method to do this please.

Thanks.

-- shufilkhan
amazon-eks
amazon-web-services
cockroachdb
kubernetes

1 Answer

1/30/2022

the best way is to use the CockroachDB for backup.

CREATE SCHEDULE schedule_label
  FOR BACKUP INTO 's3://test/backups/schedule_test?AWS_ACCESS_KEY_ID=x&AWS_SECRET_ACCESS_KEY=x'
    WITH revision_history
    RECURRING '@daily';

you can schedule the exact run time using the RECURRING parameter.

CREATE SCHEDULE schedule_database
  FOR BACKUP DATABASE movr INTO 's3://test/schedule-database?AWS_ACCESS_KEY_ID=x&AWS_SECRET_ACCESS_KEY=x'
    WITH revision_history
    RECURRING '1 0 * * *';

the documentation link is this

-- Aria Shahdadi
Source: StackOverflow