ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Di Li <>
Subject Re: Ru/EU not updating alert definitions in Ambari server db?
Date Tue, 23 Feb 2016 19:24:42 GMT
Hello folks,

Thanks for the reply. I have my own stack called MyStack 1.0 and MyStack 2.0. I found the
issue after I heavily refactored the MyStack directory structure.

1. In Ambari 2.1/MyStack 1.0, I have Flume's defined as MyStack/1.0/services/FLUME/package/alerts/
2. In Ambari 2.2, I changed the structure of MyStack to make use of common services, so 
   a) The Flume directories are moved into common-services
   b) MyStack 1.0 now contains a Flume dir with just a metainfo.xml file.
   c) I also added MyStack 2.0 so I can run RU/EU. MyStack 2.0 also only contains a Flume
dir with just a metainfo.xml file.
   d) common-services has Flume agent alert Python script as FLUME/
(note the custom version I used here...). As you can see, I changed the path to the
3. Perform RU

-- Post RU, I saw Flume agent produced an "UNKNOWN" alert with an error message
Flume Agent Status
Unable to find 'MyStack/1.0/services/FLUME/package/alerts/' as
an absolute path or part of /var/lib/ambari-agent/cache/stacks or /var/lib/ambari-agent/cache/host_scripts

-- I noticed tht in the Ambari server database, the Flume agent alert definition had the wrong
patch to the Python script as shown below. It still has the old MyStack based path.
9 |          2 | flume_agent_status                            
| FLUME          | FLUME_HANDLER       |
 ANY     | Flume Agent Status                              
| This host-level alert is triggered if any of the expect
ed flume agent processes are not available.
       |       1 |                 1 | SCRIPT      | {"path":"MyStack/1.0/services/FLUME/package/alerts/alert_flu","parameters":[{"name":"","display_name":"Run Directory","value":"/var/run/flume","de
scription":"The directory where flume agent processes will place their PID files.","type":"STRING"}],"type":"SCRIPT"}

-- This prompted me to ask the question about whether the alert definition should have been
updated by RU/EU (or ambari server upgrade maybe).

-- I was able to update Flume agent's alert definition with the correct path via following
curl -u admin:admin -H 'X-Requested-By:ambari' -X PUT -d '{"AlertDefinition" : {"source" :
{"path" : "FLUME/",      "type" :
"SCRIPT" }}}'

      From: Jonathan Hurley <>
 To: "" <>; Di Li <>

 Sent: Tuesday, February 23, 2016 1:23 PM
 Subject: Re: Ru/EU not updating alert definitions in Ambari server db?
No, they are not updated; however, stack inheritance should allow you to reference the files
from the new stack. We've performed many different upgrades both both inter-stack and intra-stack
and have never seen any issues with alert definitions. 

> On Feb 23, 2016, at 1:13 PM, Di Li <> wrote:
> Hello folks,
> Do RU and EU handle updating alert definitions stored in the Ambari server database?

> Based on what I tested, alert definitions, especially the paths to alert_***.py Python
scripts are not updated by neither RU and EU. meaning if I changed the path to the alert_***.py
scripts in a new release, the alert definitions are broken and certain components would show
with a UNKNOWN alert state after I run RU/EU.
> P.S
>    I know that, post upgrade, I can manually update the alert definitions via REST
> Thanks.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message