-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48589/#review137494
-----------------------------------------------------------



I don't think we need to special case this. Consider the alert definitions for 
HDFS and YARN:

{code:title=HDFS}
            "high_availability": {
              "nameservice": "{{hdfs-site/dfs.internal.nameservices}}",
              "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
              "http_pattern" : 
"{{hdfs-site/dfs.namenode.http-address.{{ha-nameservice}}.{{alias}}}}",
              "https_pattern" : 
"{{hdfs-site/dfs.namenode.https-address.{{ha-nameservice}}.{{alias}}}}"
            }
{code}

{code:title=YARN}
            "high_availability": {
              "alias_key" : "{{yarn-site/yarn.resourcemanager.ha.rm-ids}}",
              "http_pattern" : 
"{{yarn-site/yarn.resourcemanager.webapp.address.{{alias}}}}",
              "https_pattern" : 
"{{yarn-site/yarn.resourcemanager.webapp.https.address.{{alias}}}}"
            }
{code}

HDFS has a {{nameservice}} key as part of the URI and YARN does not. That's the 
way we can tell what to do:

- If {{nameservice}} is defined as a key on the definition _and_ it exists in 
the configuration ({{hdfs-site}} for example) then {{alias_key}} must resolve
- If {{nameservice}} is *NOT* defined on the definition, then only use HA if 
{{alias_key}} resolves.


ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py (lines 397 - 400)
<https://reviews.apache.org/r/48589/#comment202631>

    I think this will be the first time that we've ever special-cased anything 
in the alerts framework. There has to be a better way. If you want to check for 
a specific property, then we should extend the alert definition's `uri` element 
to indicate that there is a value which can be checked for HA mode.


- Jonathan Hurley


On June 13, 2016, 10:21 a.m., Miklos Gergely wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48589/
> -----------------------------------------------------------
> 
> (Updated June 13, 2016, 10:21 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Oliver Szabo, and Sumit Mohanty.
> 
> 
> Bugs: AMBARI-17180
>     https://issues.apache.org/jira/browse/AMBARI-17180
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> base_alert.py puts a warning into the log if there are properties referenced 
> in the HA nameservice or the alias which are not present in the 
> configuration. The absence of these properties is an indicator that the HA is 
> not enabled, it is not a cause for warning.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py 6c8ca5a 
>   ambari-agent/src/test/python/ambari_agent/TestAlerts.py e114daa 
> 
> Diff: https://reviews.apache.org/r/48589/diff/
> 
> 
> Testing
> -------
> 
> Tested on local cluster works fine. Unit tests are running fine too.
> 
> 
> Thanks,
> 
> Miklos Gergely
> 
>

Reply via email to