Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMBARI-24926] Apply user-defined configuration for Add Service request. #2639

Merged
merged 1 commit into from Nov 21, 2018

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Apply configuration specified in Add Service request (cluster- and service-level), instead of using stack defaults.

Config groups and stack advisor config recommendations are not yet implemented.

https://issues.apache.org/jira/browse/AMBARI-24926

How was this patch tested?

Tested API request on existing cluster:

$ curl -X POST -d @- "http://${AMBARI_SERVER}:8080/api/v1/clusters/TEST/services" <<-EOF
{
  "operation_type": "ADD_SERVICE",
  "stack_name": "HDP",
  "stack_version": "3.0",
  "components": [
    { "component_name": "KAFKA_BROKER", "fqdn": "c7402.ambari.apache.org" },
    { "component_name": "METRICS_COLLECTOR", "fqdn": "c7402.ambari.apache.org" },
    { "component_name": "METRICS_MONITOR", "fqdn": "c7401.ambari.apache.org" },
    { "component_name": "METRICS_MONITOR", "fqdn": "c7402.ambari.apache.org" }
  ],
  "configurations": [
    {
      "cluster-env": {
        "properties": {
          "custom-property": "whatever"
        }
      }
    },
    {
      "zoo.cfg": {
        "properties": {
          "syncLimit": "7"
        }
      }
    },
    {
      "core-site": {
        "properties": {
          "fs.defaultFS": "ZZZ"
        }
      }
    },
    {
      "kafka-broker": {
        "properties": {
          "zookeeper.connect": "c7401.ambari.apache.org:2181,c7402.ambari.apache.org:2181"
        }
      }
    },
    {
      "ams-site": {
        "properties": {
          "timeline.metrics.hbase.init.check.enabled": "false"
        }
      }
    }
  ]
}
EOF

HTTP/1.1 202 Accepted
...
{
  "href" : "http://c7401.ambari.apache.org:8080/api/v1/clusters/TEST/requests/12",
  "Requests" : {
    "id" : 12,
    "status" : "Accepted"
  }
}

After the request completed, I have verified that the configs from the request have been applied for both new and existing services by exporting the cluster as blueprint. Note that the config core-site was ignored, since HDFS was not present in the cluster, neither was it added as a new service in the request.

$ curl "http://c7401.ambari.apache.org:8080/api/v1/clusters/TEST?format=blueprint"
{
  "configurations" : [
    {
      "zoo.cfg" : {
        "properties" : {
          "syncLimit" : "7"
        }
      }
    },
    {
      "kafka-broker" : {
        "properties" : {
          "zookeeper.connect" : "%HOSTGROUP::host_group_1%:2181,%HOSTGROUP::host_group_2%:2181"
        }
      }
    },
    {
      "cluster-env" : {
        "properties" : {
          "custom-property" : "whatever"
        }
      }
    },
    {
      "ams-site" : {
        "properties" : {
          "timeline.metrics.hbase.init.check.enabled" : "false"
        }
      }
    }
  ],
  "host_groups" : [
    {
      "components" : [
        { "name" : "KAFKA_BROKER" },
        { "name" : "ZOOKEEPER_SERVER" },
        { "name" : "METRICS_MONITOR" },
        { "name" : "ZOOKEEPER_CLIENT" },
        { "name" : "METRICS_COLLECTOR" }
      ],
      "name" : "host_group_2",
      "cardinality" : "1"
    },
    {
      "components" : [
        { "name" : "ZOOKEEPER_SERVER" },
        { "name" : "AMBARI_SERVER" },
        { "name" : "METRICS_MONITOR" },
        { "name" : "ZOOKEEPER_CLIENT" }
      ],
      "name" : "host_group_1",
      "cardinality" : "1"
    }
  ],
  "Blueprints" : {
    "stack_name" : "HDP",
    "stack_version" : "3.0"
  }
}

Also checked service config versions on the web UI.

Change-Id: I0396a489cf235074cc2f52f4b8b5c166bff59d50
@adoroszlai adoroszlai self-assigned this Nov 21, 2018
@asfgit
Copy link

asfgit commented Nov 21, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4602/
Test FAILed.
Test FAILured.

@adoroszlai
Copy link
Contributor Author

retest this please

@asfgit
Copy link

asfgit commented Nov 21, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/4603/
Test PASSed.

@adoroszlai adoroszlai merged commit fe80b39 into apache:trunk Nov 21, 2018
@adoroszlai adoroszlai deleted the AMBARI-24926_trunk branch November 21, 2018 16:34
vishalsuvagia pushed a commit to vishalsuvagia/ambari that referenced this pull request Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants