Cluster template structure

Cluster templates used in CDP use the following structure.

{
  "cdhVersion": "7.0.0",
  "displayName": "dataengineering",
  "services": [
    {
      "refName": "zookeeper",
      "serviceType": "ZOOKEEPER",
      "roleConfigGroups": [
        {
          "refName": "zookeeper-SERVER-BASE",
          "roleType": "SERVER",
          "base": true
        }
      ]
    },
    {
      "refName": "hdfs",
      "serviceType": "HDFS",
      "roleConfigGroups": [
        {
          "refName": "hdfs-NAMENODE-BASE",
          "roleType": "NAMENODE",
          "base": true
        },
        {
          "refName": "hdfs-SECONDARYNAMENODE-BASE",
          "roleType": "SECONDARYNAMENODE",
          "base": true
        },
        {
          "refName": "hdfs-DATANODE-BASE",
          "roleType": "DATANODE",
          "base": true
        },
        {
          "refName": "hdfs-BALANCER-BASE",
          "roleType": "BALANCER",
          "base": true
        }
      ]
    },
    {
      "refName": "yarn",
      "serviceType": "YARN",
      "roleConfigGroups": [
        {
          "refName": "yarn-RESOURCEMANAGER-BASE",
          "roleType": "RESOURCEMANAGER",
          "base": true
        },
        {
          "refName": "yarn-NODEMANAGER-WORKER",
          "roleType": "NODEMANAGER",
          "base": false
        },
        {
          "refName": "yarn-NODEMANAGER-COMPUTE",
          "roleType": "NODEMANAGER",
          "base": false
        },
        {
          "refName": "yarn-JOBHISTORY-BASE",
          "roleType": "JOBHISTORY",
          "base": true
        }
      ]
    },
    {
      "refName": "spark_on_yarn",
      "serviceType": "SPARK_ON_YARN",
      "roleConfigGroups": [
        {
          "refName": "spark_on_yarn-SPARK_YARN_HISTORY_SERVER-BASE",
          "roleType": "SPARK_YARN_HISTORY_SERVER",
          "base": true
        },
        {
          "refName": "spark_on_yarn-GATEWAY-BASE",
          "roleType": "GATEWAY",
          "base": true
        }
      ]
    },
    {
      "refName": "tez",
      "serviceType": "TEZ",
      "serviceConfigs": [
        {
          "name": "yarn_service",
          "ref": "yarn"
        }
      ],
      "roleConfigGroups": [
        {
          "refName": "tez-GATEWAY-BASE",
          "roleType": "GATEWAY",
          "base": true
        }
      ]
    },
    {
      "refName": "hms",
      "serviceType": "HIVE",
      "displayName": "Hive Metastore",
      "roleConfigGroups": [
        {
          "refName": "hms-GATEWAY-BASE",
          "roleType": "GATEWAY",
          "base": true
        },
        {
          "refName": "hms-HIVEMETASTORE-BASE",
          "roleType": "HIVEMETASTORE",
          "base": true
        }
      ]
    },
    {
      "refName": "hive_on_tez",
      "serviceType": "HIVE_ON_TEZ",
      "displayName": "Hive",
      "serviceConfigs": [
        {
          "name": "hms_connector",
          "ref": "hms"
        },
        {
          "name": "tez_service",
          "ref": "tez"
        },
        {
          "name": "zookeeper_service",
          "ref": "zookeeper"
        },
        {
          "name": "mapreduce_yarn_service",
          "ref": "yarn"
        }
      ],
      "roleConfigGroups": [
        {
          "refName": "hive_on_tez-GATEWAY-BASE",
          "roleType": "GATEWAY",
          "base": true
        },
        {
          "refName": "hive_on_tez-HIVESERVER2-BASE",
          "roleType": "HIVESERVER2",
          "base": true
        }
      ]
    },
    {
      "refName": "hue",
      "serviceType": "HUE",
      "roleConfigGroups": [
        {
          "refName": "hue-HUE_SERVER-BASE",
          "roleType": "HUE_SERVER",
          "base": true
        }
      ]
    },
    {
      "refName": "livy",
      "serviceType": "LIVY",
      "roleConfigGroups": [
        {
          "refName": "livy-GATEWAY-BASE",
          "roleType": "GATEWAY",
          "base": true
        },
        {
          "refName": "livy-LIVY_SERVER-BASE",
          "roleType": "LIVY_SERVER",
          "base": true
        }
      ]
    },
    {
      "refName": "zeppelin",
      "serviceType": "ZEPPELIN",
      "serviceConfigs": [
        {
          "name": "yarn_service",
          "ref": "yarn"
        },
        {
          "name": "hdfs_service",
          "ref": "hdfs"
        },
        {
          "name": "spark_on_yarn_service",
          "ref": "spark_on_yarn"
        }
      ],
      "roleConfigGroups": [
        {
          "refName": "zeppelin-ZEPPELIN_SERVER-BASE",
          "roleType": "ZEPPELIN_SERVER",
          "base": true
        }
      ]
    },
    {
      "refName": "oozie",
      "serviceType": "OOZIE",
      "roleConfigGroups": [
        {
          "refName": "oozie-OOZIE_SERVER-BASE",
          "roleType": "OOZIE_SERVER",
          "base": true
        }
      ]
    }
  ],
  "hostTemplates": [
    {
      "refName": "master",
      "cardinality": 1,
      "roleConfigGroupsRefNames": [
        "hdfs-BALANCER-BASE",
        "hdfs-NAMENODE-BASE",
        "hdfs-SECONDARYNAMENODE-BASE",
        "hms-GATEWAY-BASE",
        "hms-HIVEMETASTORE-BASE",
        "hive_on_tez-HIVESERVER2-BASE",
        "hive_on_tez-GATEWAY-BASE",
        "hue-HUE_SERVER-BASE",
        "tez-GATEWAY-BASE",
        "spark_on_yarn-GATEWAY-BASE",
        "spark_on_yarn-SPARK_YARN_HISTORY_SERVER-BASE",
        "livy-LIVY_SERVER-BASE",
        "zeppelin-ZEPPELIN_SERVER-BASE",
        "oozie-OOZIE_SERVER-BASE",
        "yarn-JOBHISTORY-BASE",
        "yarn-RESOURCEMANAGER-BASE",
        "zookeeper-SERVER-BASE"
      ]
    },
    {
      "refName": "worker",
      "cardinality": 1,
      "roleConfigGroupsRefNames": [
        "hdfs-DATANODE-BASE",
        "hms-GATEWAY-BASE",
        "hive_on_tez-GATEWAY-BASE",
        "tez-GATEWAY-BASE",
        "spark_on_yarn-GATEWAY-BASE",
        "livy-GATEWAY-BASE",
        "yarn-NODEMANAGER-WORKER"
      ]
    },
    {
      "refName": "compute",
      "cardinality": 0,
      "roleConfigGroupsRefNames": [
        "hms-GATEWAY-BASE",
        "hive_on_tez-GATEWAY-BASE",
        "tez-GATEWAY-BASE",
        "spark_on_yarn-GATEWAY-BASE",
        "yarn-NODEMANAGER-COMPUTE"
      ]
    }
  ]
}