You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Andrew Onischuk <ao...@hortonworks.com> on 2016/01/29 12:31:39 UTC

Review Request 42959: ambari agent upstart support

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

Review request for Ambari and Myroslav Papirkovskyy.


Bugs: AMBARI-14842
    https://issues.apache.org/jira/browse/AMBARI-14842


Repository: ambari


Description
-------

Context:  
It is critical that we have a service that can auto-restart during crashes and
reboots. This is done via upstart on Ubuntu.  
The issue is that Ambari-Agent scripts in the current state is not upstart-
able due to some implementation issues.  
So to make this upstart-able, we had to directly take a dependency into a
helper script for Ambari-Agent (as per user1 recommendation). However, this
dependency turned out to be fragile, since it broke in HDP 2.4. So this JIRA
is about making ambari agent upstartable directly when we install Ambari, so
users doesn’t have to resort to a fragile dependency. We made it work  
Details:  
The way to start ambari-agent and ambari-server are different for user1 and
user2.  
In the case for ambari-agent:  
user1 calls "/etc/init.d/ambari-agent" (which invokes /usr/sbin/ambari-agent)
to start ambari agent.  
user2 uses "/etc/init/ambari-agent" (which directly calls /usr/lib/python2.6
/site-packages/ambari_agent/main.py) to start ambari-agent.  
user2 has to call ambari-agent/main.py directly is because we need upstart to
re-start services when it crashes unexpectedly and upstart does not work if we
configure it to call /usr/sbin/ambari-agent.  
The reason is that upstart needs to track the process for the service (i.e.
ambari-agent) that it needs to restart; however, /usr/sbin/ambari-agent
executes lots of commands that would result in new processes being spawned and
will confuse upstart the "main" process it should be tracking.  
We need user1 to give us a upstart-compatible script otherwise HDP changes can
break us unexpectedly.  
We also have a upstart script for ambari-server for the same reason.  
Attaching both scripts for user1 to take a look.


Diffs
-----

  ambari-agent/conf/unix/ambari-agent 4f9e1e5 
  ambari-agent/etc/init/ambari-agent.conf PRE-CREATION 
  ambari-agent/pom.xml 346ac07 

Diff: https://reviews.apache.org/r/42959/diff/


Testing
-------

mvn clean test


Thanks,

Andrew Onischuk


Re: Review Request 42959: ambari agent upstart support

Posted by Myroslav Papirkovskyy <mp...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42959/#review116939
-----------------------------------------------------------


Ship it!




Ship It!

- Myroslav Papirkovskyy


On Січ. 29, 2016, 1:31 після полудня, Andrew Onischuk wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/42959/
> -----------------------------------------------------------
> 
> (Updated Січ. 29, 2016, 1:31 після полудня)
> 
> 
> Review request for Ambari and Myroslav Papirkovskyy.
> 
> 
> Bugs: AMBARI-14842
>     https://issues.apache.org/jira/browse/AMBARI-14842
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Context:  
> It is critical that we have a service that can auto-restart during crashes and
> reboots. This is done via upstart on Ubuntu.  
> The issue is that Ambari-Agent scripts in the current state is not upstart-
> able due to some implementation issues.  
> So to make this upstart-able, we had to directly take a dependency into a
> helper script for Ambari-Agent (as per user1 recommendation). However, this
> dependency turned out to be fragile, since it broke in HDP 2.4. So this JIRA
> is about making ambari agent upstartable directly when we install Ambari, so
> users doesn’t have to resort to a fragile dependency. We made it work  
> Details:  
> The way to start ambari-agent and ambari-server are different for user1 and
> user2.  
> In the case for ambari-agent:  
> user1 calls "/etc/init.d/ambari-agent" (which invokes /usr/sbin/ambari-agent)
> to start ambari agent.  
> user2 uses "/etc/init/ambari-agent" (which directly calls /usr/lib/python2.6
> /site-packages/ambari_agent/main.py) to start ambari-agent.  
> user2 has to call ambari-agent/main.py directly is because we need upstart to
> re-start services when it crashes unexpectedly and upstart does not work if we
> configure it to call /usr/sbin/ambari-agent.  
> The reason is that upstart needs to track the process for the service (i.e.
> ambari-agent) that it needs to restart; however, /usr/sbin/ambari-agent
> executes lots of commands that would result in new processes being spawned and
> will confuse upstart the "main" process it should be tracking.  
> We need user1 to give us a upstart-compatible script otherwise HDP changes can
> break us unexpectedly.  
> We also have a upstart script for ambari-server for the same reason.  
> Attaching both scripts for user1 to take a look.
> 
> 
> Diffs
> -----
> 
>   ambari-agent/conf/unix/ambari-agent 4f9e1e5 
>   ambari-agent/etc/init/ambari-agent.conf PRE-CREATION 
>   ambari-agent/pom.xml 346ac07 
> 
> Diff: https://reviews.apache.org/r/42959/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Andrew Onischuk
> 
>