Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-6686

BE: Provide host-layout validations via /validations endpoint on stack-version

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.7.0
    • ambari-server
    • None

    Description

      To enable Ambari server in giving validations, we need to provide a /validations endpoint inside the stack-version URL. Callers will then be able to ask a stack-version to validate host-layout and configurations.

      In this JIRA, we will provide just the host-layout validations where the host-layout selected by the user is given, and the API responds with validation messages.

      POST 
      http://server:8080/api/v1/stacks/HDP/versions/2.1/validations
      

      Request:

      {
        hosts: ['h1', 'h2', 'h3'],
        services: ['HDFS', 'YARN', 'HBASE'],
        recommendations: {
          blueprint: {
            configurations: {
              global: {
                ‘properties’: {
                  ‘hbase_user’: ‘hbase’,
                  ‘clientPort’: ‘2181’,
                  ‘hadoop_heapsize’: ‘1024’,
                  ...
                }
              },
              core-site: { … },
              hdfs-site: { … },
              yarn-site: { … },
              hbase-site: { … }
            },
            host_groups: [
              {
                name: ‘host-group-1’,
                components: [
                  {
                    name: ‘NAMENODE’
                  },
                  {
                    name: ‘SNAMENODE’
                  }
                ]
              },
              {
                name: ‘host-group-2’,
                components: [
                  {
                    name: ‘RESOURCEMANAGER’
                  }
                ]
              },
              {
                name: ‘host-group-3’,
                components: [
                  {
                    name: ‘DATANODE’,
                  },
                  {
                    name: ‘NODEMANAGER’,
                  },
                  {
                    name: ‘HBASE_REGIONSERVER’,
                  }
                ]
              }
            ]
          },
          blueprint_cluster_binding: {
            host_groups: [
              {
                name: ‘host-group-1’,
                hosts: [
                  {
                    fqdn: ‘c6401.ambari.apache.org’
                  }
                ]
              },
              {
                name: ‘host-group-1’,
                hosts: [
                  {
                    fqdn: ‘c6402.ambari.apache.org’
                  }
                ]
              },
              {
                name: ‘host-group-3’,
                hosts: [
                  {
                    fqdn: ‘c6403.ambari.apache.org’
                  }
                ]
              }
            ]
          }
        }
      }
      

      Response:

      {
        items: [
          {
            type: ‘configuration’,
            level: ‘ERROR’,
            message: ‘Value should be integer’,
            config-type:’mapred-site’,
            config-name:'mapreduce.map.memory.mb'
          },
          {
            type: ‘configuration’,
            level: ‘WARN’,
            message: ‘Maximum memory exceeds map memory size’,
            config-type:’mapred-site’,
            config-name:'mapreduce.map.java.opt'
          },
          {
            type: ‘configuration’,
            level: ‘ERROR’,
            message: ‘yarn.new-config should be defined for HDP-2.1 Yarn service’,
            config-type:’yarn-site’,
            config-name:'yarn.new-config'
          },
          {
            type: ‘configuration’,
            level: ‘WARN’,
            message: ‘yarn.old-config has been deprecated in HDP-2.1’,
            config-type:’yarn-site’,
            config-name:'yarn.old-config'
          },
          {
            type: ‘host-component’,
            level: ‘ERROR’,
            message: ‘NameNode and Secondary NameNode cannot be hosted on same machine’,
            component-name:’NAMENODE’,
            host:'c6401.ambari.apache.org'
          },
          {
            type: ‘host-component’,
            level: ‘ERROR’,
            message: ‘NameNode and Secondary NameNode cannot be hosted on same machine’,
            component-name:’SNAMENODE’,
            host:'c6401.ambari.apache.org'
          }
        ]
      }
      

      There will be 2 types of validation messages

      • Configuration
        • type = configuration
        • level = WARN, ERROR
        • message
        • config-type = global, core-site, …
        • config-name
        • host-group (optional)
      • Host-Component
        • type = host-component
        • level = WARN, ERROR
        • message
        • component-name: NAMENODE, SNAMENODE, …
        • host: <host-fqdn>

      There are 2 validation levels

      • WARN - value is valid, but semantically there may be issues (like > or < default)
      • ERROR - value is not valid and will cause service to fail.

      Attachments

        1. AMBARI-6686_2.patch
          81 kB
          Srimanth Gunturi
        2. AMBARI-6686.patch
          81 kB
          Srimanth Gunturi

        Activity

          People

            srimanth.gunturi Srimanth Gunturi
            srimanth.gunturi Srimanth Gunturi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: