...
Though repository base URL is capable of providing updates to a particular repo, sometimes it has to be defined at build time. This could be an issue later when the repository changes location, or update builds are hosted at a different repository locationsite.
When this is the caseFor such scenarios, a stack-version can provide the location of a JSON file which can provide details of other repo URLs to use.
...
Code Block |
---|
{ ... "HDP-2.3":{ "latest":{ "centos6":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/BUILDS/2.3.6.0-3586/", "centos7":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos7/2.x/BUILDS/2.3.6.0-3586/", "debian6":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian6/2.x/BUILDS/2.3.6.0-3586/", "debian7":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/debian7/2.x/BUILDS/2.3.6.0-3586/", "suse11":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/suse11sp3/2.x/BUILDS/2.3.6.0-3586/", "ubuntu12":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu12/2.x/BUILDS/2.3.6.0-3586/", "ubuntu14":"http://s3.amazonaws.com/dev.hortonworks.com/HDP/ubuntu14/2.x/BUILDS/2.3.6.0-3586/" } }, ... } |
Hooks
A stack-version could have very basic and common instructions that need to be run before or after certain Ambari commands, across all services.
Instead of duplicating this code across all service scripts and asking users to worry about them, Ambari provides the Hooks ability where common before and after code can be pulled away into the hooks folder. (Ex: HDP-2.0.6)
Command Sub-Folders
The general naming pattern for hooks sub-folders is "<before|after>-<ANY|<CommandName>>".
What this means is that the scripts/hook.py file under the sub-folder is run either before or after the command.
Examples:
Sub-Folder | Purpose | Example |
---|---|---|
before-START | Hook script called before START command is run on any component of the stack-version. |
|
before-INSTALL | Hook script called before installing of any component of the stack-version |
|
Based on the commands currently supported by Ambari, the following sub-folders can be created based on necessity
Prefix | - | Command | Details |
---|---|---|---|
before | - | INSTALL | |
UNINSTALL | |||
START | |||
RESTART | |||
STOP | |||
after | EXECUTE | ||
ABORT | |||
UPGRADE | |||
SERVICE_CHECK | |||
<custom_command> | Custom commands specified by the user like the DECOMMISSION or REBALANCEHDFS commands specified by HDFS |
Configurations
Stack Advisor
...