Background

At present, stack definitions are bundled with Ambari core and are part of Apache Ambari releases. This enforces having to do an Ambari release with updated stack definitions whenever a new version of a stack is released. Also to add an "add-on" service (custom service) to the stack definition, one has to manually add the add-on service to the stack definition on an Ambari Server. There is no release vehicle that can be used to ship add-on services.

Apache Ambari Management Packs addresses this issue by decoupling Ambari's core functionality (cluster management and monitoring) from stack management and definition. An Apache Ambari Management Pack (Mpack) can bundle multiple service definitions, stack definitions, stack add-on service definitions, view definitions services so that releasing these artifacts don’t enforce an Apache Ambari release. Apache Ambari Management Packs will be released as separate release artifacts and will follow its own release cadence instead of being tightly coupled with Apache Ambari releases.

Management packs are released as tarballs, however they contain a metadata file (mpack.json) that specify the contents of the management pack and actions to perform when installing the management pack.

Apache JIRA

AMBARI-14854

Release Timelines

Management Pack Metadata (Mpack.json)

Management pack should contain following metadata information in mpack.json.

Management Pack Structure

StackXYZ Management Pack Structure

stackXYZ­-ambari­-mpack-­1.0.0.0

├── mpack.json

├── common-­services

│     └── HDFS

│         └── 2.1.0.2.0

│            └── configuration

└── stacks

    └── stackXYZ

       └── 1.0

           ├── metainfo.xml

           ├── repos

           │     └── repoinfo.xml

           ├── role_command_order.json

           └── services

           ├── HDFS

           │      ├── configuration

           │      │     └── hdfs-­site.xml

           │     └── metainfo.xml

           ├── stack_advisor.py

           └── ZOOKEEPER

                   └── metainfo.xml

 

StackXYZ Management Pack Mpack.json

stackXYZ-­ambari-­mpack­1.0.0.0/mpack.json

{

    "type" : "full­-release",

    "name" : "stackXYZ-­ambari­-mpack",

    "version": "1.0.0.0",

    "description" : "StackXYZ Management Pack",

    "prerequisites": {

        "min_ambari_version" : "2.4.0.0"

    },

    "artifacts": [

        {

            "name" : "stackXYZ-service-definitions",

            "type" : "service-­definitions",

            "source_dir": "common-­services"

        },

       {

           "name" : "stackXYZ-­stack-­definitions",

           "type" : "stack­-definitions",

           "source_dir": "stacks"

        }

    ]

}

Add­-On Service Management Pack Structure

myservice-­ambari­-mpack­-1.0.0.0

├── common­-services

│     └── MYSERVICE

│         └── 1.0.0

│         ├── configuration

│         │     └── myservice­config.xml

│         ├── metainfo.xml

│         ├── package

│         │     └── scripts

│         │         ├── client.py

│         │         ├── master.py

│         │         └── slave.py

│         └── role_command_order.json

├── custom­-services

│     └── MYSERVICE

│     ├── 1.0.0

│     │    └── metainfo.xml

│     └── 2.0.0

│         └── metainfo.xml

└── mpack.json

Add­-On Service Management Pack Mpack.json

myservice-­ambari-­mpack­-1.0.0.0/mpack.json

{

    "type" : "full­-release",

    "name" : "myservice-­ambari­-mpack",

    "version": "1.0.0.0",

    "description" : "MyService Management Pack",

    "prerequisites": {

        "min-­ambari-­version" : "2.4.0.0",

        "min­-stack­-versions" : [

            {

                "stack_name" : "stackXYZ",

                "stack_version" : "2.2"

           }

        ]

    },

    "artifacts": [

        {

            "name" : "MYSERVICE­-service-definition",

            "type" : "service­-definition",

           "source_dir" : "common­-services/MYSERVICE/1.0.0",

           "service_name" : "MYSERVICE",

           "service_version" : "1.0.0"

        },

       {  

           "name" : "MYSERVICE­-1.0.0",

           "type" : "stack­-addon-service-­definition",

           "source_dir": "addon-services/MYSERVICE/1.0.0",

           "service_name" : "MYSERVICE",

           "service_version" : "1.0.0",

           "applicable_stacks" : [

               {

                   "stack_name" : "stackXYZ", "stack_version" : "2.2"

               }

            ]

        },

       {

           "name" : "MYSERVICE­-2.0.0",

           "type" : "stack-addon-service-definition",

           "source_dir": "custom­-services/MYSERVICE/2.0.0",

           "service_name" : "MYSERVICE",

           "service_version" : "2.0.0",

           "applicable_stacks" : [

               {

                   "stack_name" : "stackXYZ",

                   "stack_version" : "2.4"

                }

            ]

        }

    ]

}

Installing Management Pack

ambari-­server install-­mpack ­­--mpack=/path/to/mpack.tar.gz --­­purge --verbose

Note: Do not pass the "--purge" command line parameter when installing an add-on service management pack. The "--purge" flag is used to purge any existing stack definition (HDP is included in Ambari release) and should be included only when installing a Stack Management Pack.

Upgrading Management Pack

ambari-server upgrade-mpack --mpack=/path/to/mpack.tar.gz --verbose