...
The metainfo.xml
file in a Service describes the service, the components of the service and the management scripts to use for executing commands.
Categories of Components
A component of a service can be either a MASTER, SLAVE or CLIENT.
Management Scripts
TBD
Default Commands
TBD
Custom Commands
category. The <category> tells Ambari what default commands should be available to manage and monitor the component.
For each Component you specify the <commandScript> to use when executing commands. There is a defined set of default commands the component must support.
Component Category | Default Commands |
---|---|
MASTER | install, start, stop, configure, status |
SLAVE | install, start, stop, configure, status |
CLIENT | install, configure, status |
Ambari supports different types of commands scripts, for example PYTHON and PUPPET. The type is used to know how to execute the command scripts. You can also create custom commands if there are other commands beyond the default your component needs to support.
For example, in the YARN Service describes the ResourceManager component as follows:
Code Block |
---|
<component>
<name>RESOURCEMANAGER</name>
<category>MASTER</category>
<commandScript>
<script>scripts/resourcemanager.py</script>
<scriptType>PYTHON</scriptType>
<timeout>600</timeout>
</commandScript>
<customCommands>
<customCommand>
<name>DECOMMISSION</name>
<commandScript>
<script>scripts/resourcemanager.py</script>
<scriptType>PYTHON</scriptType>
<timeout>600</timeout>
</commandScript>
</customCommand>
</customCommands>
</component> |
The ResourceManager is a MASTER component, and the command script is scripts/resourcemanager.py
, which can be found in the services/YARN/package
directory. That command script is PYTHON and that script implements the default commands as python methods. This is the install method for the default install command:
Code Block |
---|
class Resourcemanager(Script):
def install(self, env):
self.install_packages(env)
self.configure(env)
|
You can also see a custom command is defined DECOMMISSION, which means there is also a decommission method in that python command script:
Code Block |
---|
def decommission(self, env):
import params
...
Execute(yarn_refresh_cmd,
user=yarn_user
)
pass
|
TBD
Metrics
TBD