metainfo.xml is a declarative definition of an Ambari managed service describing its content. It is the most critical file for any service definition. This section describes various key sub-sections within a metainfo.xml file.
Structure
Non-mandatory fields are described in italics.
The fields to describe a service are as follows:
name: the name of the service. A name has to be unique among all the services that are included in the stack definition containing the service.
- displayName: the display name of the service
version: the version of the service. name and version together uniquely identify a service. Usually, the version is the version of the service binary itself.
components: the list of component that the service is comprised of
osSpecifics: OS specific package information for the service
commandScript: service level commands may also be defined. The command is executed on a component instance that is a client
comment: a short description describing the service
requiredServices: what other services that should be present on the cluster
configuration-dependencies: configuration files that are expected by the service (config files owned by other services are specified in this list)
service/components - A service contains several components. The fields associated with a component are:
name: name of the component
category: type of the component - MASTER, SLAVE, and CLIENT
commandScript: application wide commands may also be defined. The command is executed on a component instance that is a client
- cardinality: allowed/expected number of instances
versionAdvertised: does the component advertise its version - used during rolling/express upgrade
timelineAppid: the default category used to store generated metrics data
dependencies: the list of components that this component depends on
customCommands: a set of custom commands associated with the component in addition to standard commands
service/osSpecifics - OS specific package names (rpm or deb packages)
osFamily: the os family for which the package is applicable
packages: list of packages that are needed to deploy the service
package/name: name of the package (will be used by the yum/zypper/apt commands)
service/commandScript - the script that implements service check (see service/component/customCommand below)
service/component/commandScript - the script that implements components specific default commands (see service/component/customCommand below)
service/component/customCommand - custom commands can be added to components.
- name: name of the custom command
- commandScript: the details of the script that implements the custom command
- commandScript/script: the relative path to the script
- commandScript/scriptType: the type of the script, currently only supported type is PYTHON
- commandScript/timeout: custom timeout for the command - this supersedes ambari default
service/component/configFiles - list of config files to be available when client config is to be downloaded (used to configure service clients that are not managed by Ambari)
- type: the type of file to be generated, xml or env sh, yaml, etc
- fileName: name of the generated file
- dictionary: data dictionary that contains the config properties (relevant to how ambari manages config bags internally)
Sample metainfo.xml
<metainfo> |
---|