Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

YARN status become critical, warning, ok every 2 minute it being changes with below error from ambari?

Solved Go to solution
Highlighted

YARN status become critical, warning, ok every 2 minute it being changes with below error from ambari?

i followed the below steps to resolve issue. but i'm getting error.

kindly provide the solution.

Steps:

1) find the alert REST url

curl -u admin:$AMBARI_PASSWORD -H "X-Requested-by:ambari" -k -X GET http://$AMBARI_SERVER:8080/api/v1/clusters/$CLUSTER_NAME/alert_definitions?AlertDefiition/name=yarn_... you should get something like: { "href" : "http://$AMBARI_SERVER:8080/api/v1/clusters/$CLUSTER_NAME/alert_definitions?AlertDefinition/name=yarn...", "items" : [ { "href" : "http://$AMBARI_SERVER:8080/api/v1/clusters/$CLUSTER_NAME/alert_definitions/33", "AlertDefinition" : { "cluster_name" : "$CLUSTER_NAME", "id" : 33, "label" : "App Timeline Web UI", "name" : "yarn_app_timeline_server_webui" } } ] } 2) Get the actual alert definition Take the inner "href" value (in red, above) and run a second GET command to get the actual definition of the alert. Following the example above (note that the "id", which is 33 in the example, could be different in your case): curl -u admin:$AMBARI_PASSWORD -H "X-Requested-by:ambari" -k -X GET http://$AMBARI_SERVER:8080/api/v1/clusters/$CLUSTER_NAME/alert_definitions/33 > app_def.json the content of output file app_def.json should look similar to: { "href" : "http://$AMBARI_SERVER:8080/api/v1/clusters/$CLUSTER_NAME/alert_definitions/33", "AlertDefinition" : { "cluster_name" : "$CLUSTER_NAME", "component_name" : "APP_TIMELINE_SERVER", "description" : "This host-level alert is triggered if the App Timeline Server Web UI is unreachable.", "enabled" : true, "id" : 33, "ignore_host" : false, "interval" : 1, "label" : "App Timeline Web UI", "name" : "yarn_app_timeline_server_webui", "scope" : "ANY", "service_name" : "YARN", "source" : { "reporting" : { "critical" : { "text" : "Connection failed to {1} ({3})" }, "ok" : { "text" : "HTTP {0} response in {2:.3f}s" }, "warning" : { "text" : "HTTP {0} response from {1} in {2:.3f}s ({3})" } }, "type" : "WEB", "uri" : { "kerberos_principal" : "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.principal}}", "connection_timeout" : 5.0, "kerberos_keytab" : "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.keytab}}", "http" : "{{yarn-site/yarn.timeline-service.webapp.address}}", "https_property" : "{{yarn-site/yarn.http.policy}}", "https_property_value" : "HTTPS_ONLY", "default_port" : 0.0, "https" : "{{yarn-site/yarn.timeline-service.webapp.https.address}}" } } } } 3) Change the timeout value in the json file Edit the file app_def.json and to increase the timeout of the alert change the value (these are seconds) from "connection_timeout" : 5.0, to, for example ,12.0: "connection_timeout" : 12.0, ==== There is a second important change to do the the json file to workaround an issue with amabari and is to also change: "default_port" : 0.0, to "default_port" : 0,

4) Send back the new definition to Ambari Issue the command (as usual check that the url is the one found at point 1): curl -u admin:$AMBARI_PASSWORD -H "X-Requested-by:ambari" -k -X PUT -d @app_def.json http://$AMBARI_SERVER:8080/api/v1/clusters/$CLUSTER_NAME/alert_definitions/33

ERROR:

{

"status" : 400,

"message" : "org.apache.ambari.server.controller.spi.UnsupportedPropertyException: The properties [href] specified in the request or predicate are not supported for the resource type AlertDefinition."

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: YARN status become critical, warning, ok every 2 minute it being changes with below error from ambari?

Super Mentor

@kishore sanchina

Before you do the "-X PUT" the "app_def.json" you must delete the "href" line from very second line of your json file.

View solution in original post

3 REPLIES 3
Highlighted

Re: YARN status become critical, warning, ok every 2 minute it being changes with below error from ambari?

Super Mentor

@kishore sanchina

Before you do the "-X PUT" the "app_def.json" you must delete the "href" line from very second line of your json file.

View solution in original post

Highlighted

Re: YARN status become critical, warning, ok every 2 minute it being changes with below error from ambari?

Super Mentor

@kishore sanchina

For example when you will access the API:

http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alert_definitions/33

Then you might get the following kind of output:

{
  href: "http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alert_definitions/33",
  AlertDefinition: {
    cluster_name: "ErieCluster",
    component_name: "APP_TIMELINE_SERVER",
    description: "This host-level alert is triggered if the App Timeline Server Web UI is unreachable.",
    enabled: true,
    help_url: null,
    id: 47,
    ignore_host: false,
    interval: 1,
    label: "App Timeline Web UI",
    name: "yarn_app_timeline_server_webui",
    repeat_tolerance: 1,
    repeat_tolerance_enabled: false,
    scope: "ANY",
    service_name: "YARN",
    source: {
      reporting: {
        ok: {
          text: "HTTP {0} response in {2:.3f}s"
        },
        warning: {
          text: "HTTP {0} response from {1} in {2:.3f}s ({3})"
        },
        critical: {
          text: "Connection failed to {1} ({3})"
        }
      },
      type: "WEB",
      uri: {
        http: "{{yarn-site/yarn.timeline-service.webapp.address}}/ws/v1/timeline",
        https: "{{yarn-site/yarn.timeline-service.webapp.https.address}}/ws/v1/timeline",
        https_property: "{{yarn-site/yarn.http.policy}}",
        https_property_value: "HTTPS_ONLY",
        kerberos_keytab: "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.keytab}}",
        kerberos_principal: "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.principal}}",
        default_port: 0,
        connection_timeout: 5
      }
    }
  }
}

- Then while putting the above edited JSON data back to ambari you should remove the second line from it ...which is following:

href: "http://erie1.example.com:8080/api/v1/clusters/ErieCluster/alert_definitions/33"

.

Re: YARN status become critical, warning, ok every 2 minute it being changes with below error from ambari?

@Jay SenSharma thanks jay. now it is working fine and issue resolved.

Don't have an account?
Coming from Hortonworks? Activate your account here