Each service can define its own role command order by including a role_command_order.json file in its service folder.  The service should only specify the relationship of its components to other components.  In other words, if a service only includes COMP_X, it should only list dependencies related to COMP_X.  If when COMP_X starts it is dependent on the NameNode start and when the NameNode stops it should wait for COMP_X to stop, the following would be included in the role command order:

{
  "_comment" : "Record format:",
  "_comment" : "blockedRole-blockedCommand: [blockerRole1-blockerCommand1, blockerRole2-blockerCommand2, ...]",
  "general_deps" : {
    "_comment" : "dependencies for all cases"
  },
  "_comment" : "Dependencies that are used when GLUSTERFS is not present in cluster",
  "optional_no_glusterfs": {
    "COMP_X-START": ["NAMENODE-START"],
    "NAMENODE-STOP": ["COMP_X-STOP"]
  }
} 

The entries in the service's role command order will be merged with the role command order defined in the stack.  For example, since the stack already has a dependency for NAMENODE-STOP, in the example above COMP_X-STOP would be added to the rest of the NAMENODE-STOP dependencies and the COMP_X-START dependency on NAMENODE-START would be added as a new dependency.

Sections

Ambari uses the below sections only:

Section NameWhen Used

general_deps

Command orders are applied in all situations

optional_glusterfs

Command orders are applied when cluster has instance of GLUSTERFS service

optional_no_glusterfs

Command orders are applied when cluster does not have instance of GLUSTERFS service

namenode_optional_ha

Command orders are applied when HDFS service is installed and JOURNALNODE component exists (HDFS HA is enabled)

resourcemanager_optional_ha

Command orders are applied when YARN service is installed and multiple RESOURCEMANAGER host-components exist (YARN HA is enabled)

Commands

Commands currently supported by Ambari are

  • INSTALL
  • UNINSTALL
  • START
  • RESTART
  • STOP
  • EXECUTE
  • ABORT
  • UPGRADE
  • SERVICE_CHECK
  • CUSTOM_COMMAND
  • ACTIONEXECUTE

 

For more details on role command order, see the Stack’s Role Command Order page.

  • No labels