Backing up and restoring CDE jobsPDF version

Backing up Cloudera Data Engineering jobs

You can back up Cloudera Data Engineering (CDE) jobs and associated resources. Backups are saved as zip files that can be used to restore jobs and their associated resources.

Before you begin

  • Download and configure the CDE CLI.

Steps

  1. Run the cde backup create command to create a backup of the jobs in the virtual cluster your CDE CLI is configured to interact with. By default, all job configurations in the cluster are backed up, but the resources are not. You can use command flags to change this behavior as follows:
    --include-job-resources
    Backs up all resources associated with the selected jobs. These resources cannot be filtered out by the --resource-filter parameter.
    --include-jobs
    Backs up all jobs in the virtual cluster. This is the default behavior.
    --include-resources
    Backs up all resources in the virtual cluster, including those not associated with jobs.
    --job-filter <filter_string>
    Selects jobs to back up using the fieldname[operator]argument syntax. This command flag can be repeated.
    --resource-filter <filter_string>
    Selects resources to back up using the fieldname[operator]argument syntax. This command flag can be repeated.
    --local-path <filename>
    Specifies the local file path and name to store the backup. By default, the backup filename is archive-<timestamp>.zip.

    For example, to backup all jobs containing the string etl and include all resources associated with those jobs:

    cde backup create --job-filter "name[like]%etl%" --include-job-resources
  2. Validate the backup using the cde backup list-archive command. For example:
    cde backup list-archive --local-path archive-2021-11-10T01:24:06.zip

    Confirm that all jobs and resources that you expected to be backed up are included.

Result

The output of cde backup list-archive is similar to the following:

[
  {
    "entityType": "Resource",
    "cdeVersion": "1.13.0-b199",
    "clusterID": "cluster-n5kmqmwr",
    "appID": "dex-app-47m2j5qz",
    "name": "etl-jars",
    "adjustedName": "etl-jars",
    "archiveDirectoryPath": "v1/resources/v1/709c2910-9695-4496-8f18-5d39a8771c7d/",
    "user": "psherman",
    "backupDate": "2021-11-10T01:24:06.34440405Z"
  },
  {
    "entityType": "Job",
    "cdeVersion": "1.13.0-b199",
    "clusterID": "cluster-n5kmqmwr",
    "appID": "dex-app-47m2j5qz",
    "name": "etl-demo",
    "adjustedName": "etl-demo",
    "archiveDirectoryPath": "v1/jobs/v1/507961fd-f787-4b7c-87d7-7b441bbade73/",
    "user": "psherman",
    "backupDate": "2021-11-10T01:24:06.34440405Z"
  }
]

To restore a backup file, see Restoring Cloudera Data Engineering jobs from backup.