Step 4: Link the mpack on the Apache Ambari server

Once linked to the HDP stack, you can add the Data Optimizer file service to the cluster as if Data Optimizer is contained in the stack, using the Linux curl utility to create the link. You can perform this step on any Linux host with curl and network access to the Apache Ambari REST API.

  1. Create the mpack link with the following curl command:

    curl -u <user>:<password> \
    http://<server>:<port>/api/v1/links/ \
    -H 'X-Requested-By: ambari' -X POST \
    -d '
    {
      "ExtensionLink": {
        "stack_name": "HDP", 
        "stack_version":"<hdp_stack_version>", 
        "extension_name": "ldo", 
        "extension_version": "1.0.0.0"
      }
    }'
    

    Where:

    • <user>:<password>

      Username and password for the Ambari administrator.

    • <server>:<port>

      Ambari server’s host name or IP, and the Ambari server’s port.

    • <hdp_stack_version>

      HDP stack version running on the cluster you are deploying Data Optimizer to. Typically, this is just the major.minor version number, for example, 3.1. You can query this value from Ambari using the following command:

      curl -u <user>:<password> \
      http://<server>:<port>/api/v1/clusters/<cluster_name>/stack_versions
      
  2. Verify the links were properly created by querying the Apache Ambari API as follows:

    curl -u
            <user>:<password> \ http://<server>:<port>/api/v1/links/

    You should get a response such as the following:

    {
      "href" : "http://<server>:<port>/api/v1/links/",
      "items" : [
        {
          "href" : "http://<server>:<port>/api/v1/links/1",
          "ExtensionLink" : {
            "extension_name" : "ldo",
            "extension_version" : "1.0.0.0",
            "link_id" : 1,
            "stack_name" : "HDP",
            "stack_version" : "3.1"
          }
        }
      ]
    }
    
  3. Restart the Apache Ambari server.

    This refreshes Apache Ambari server’s stale memory cache so it recognizes the Data Optimizer extension.

Last updated

Was this helpful?