Importing the Template to a New Cluster

Complete the steps below to import the cluster template.

You can only import a cluster template to create a new cluster that is running the same version of Cloudera Runtime as the cluster from which the template was exported.
  1. (Optional) If you are restoring the configuration from a redacted backup JSON file, you must replace all entries with the word "REDACTED" with the appropriate value.
  2. Log in to the Cloudera Manager server as root.
  3. Run the following command to import the template. If you have remote repository URLS configured in the source cluster, append the command with ?addRepositories=true.
    curl -X POST -H "Content-Type: application/json" -d
          @path_to_template/template_filename.json
    http://admin_user:admin_password@cloudera_manager_url:cloudera_manager_port/api/v48/cm/importClusterTemplate
    You should see a response similar to the following:
    {
      "id" : 17,
      "name" : "ClusterTemplateImport",
      "startTime" : "2020-03-09T23:44:38.491Z",
      "active" : true,
      "children" : {
        "items" : [ ]
      }
    Examples:
    
    curl -X POST -H "Content-Type: application/json" -d @myTemplate.json http://admin:admin@myNewCluster-1.mydomain.com:7182/api/v48/cm/importClusterTemplate
    
    curl -X POST -H "Content-Type: application/json" -d @myTemplate.json http://admin:admin@myNewCluster-1.mydomain.com:7182/api/v48/cm/importClusterTemplate?addRepositories=true

    If there is no response, or you receive an error message, the JSON file may be malformed, or the template may have invalid hostnames or invalid references. Inspect the JSON file, correct any errors, and then re-run the command.

  4. Open Cloudera Manager for the new cluster in a web browser and click the Cloudera Manager logo to go to the home page.
  5. Click the All Recent Commands tab.
    If the import is proceeding, you should see a link labeled Import Cluster Template. Click the link to view the progress of the import.

    If any of the commands fail, correct the problem and click Retry. You may need to edit some properties in Cloudera Manager.

    After you import the template, Cloudera Manager applies the Autoconfiguration rules that set properties such as memory and CPU allocations for various roles. If the new cluster has different hardware or operational requirements, you may need to modify these values.