Support Questions

Find answers, ask questions, and share your expertise

How to use CM API to distribute parcel to a host

avatar
Rising Star

I am creating a python script which is based on CM API to add hosts to a cluster.

 

My challenges is:

 

I couldn't find which API call to distribute parcel to hosts especially if there is a way to install the parcel on specified hosts. I checked the following link but didn't find anything useful:

 

https://cloudera.github.io/cm_api/epydoc/5.8.0/cm_api-module.html

 

 

 

 

2 ACCEPTED SOLUTIONS

avatar
CM will automatically de-activate conflicting parcels, which is why you didn't need to de-activate 5.5.1 first. It would be a burden on the user to identify and de-activate all conflicting parcels, and this is by design.

The CM UI will show the upgrade option when you are trying to activate a CDH parcel of a higher version. This will take you through the upgrade wizard, which is generally what you want.

In your case, you don't really want the upgrade wizard and can use the API to directly activate 5.5.1 again.

If your API script should never be run when CDH is already installed, you can add a check to your script to validate that requirement.

Rather than trying to test with a single host within a cluster, you can make a test cluster with a single host and try out your API script.

View solution in original post

avatar
Oh sorry, I misunderstood.

When you add a host, CM will automatically distribute all parcels to that host and activate it so it matches all other hosts in the cluster.

View solution in original post

10 REPLIES 10

avatar
Rising Star

NP and thanks! I was also confused at the first place, when adding a new host on CM UI, there is one step which parcels being downloaded, distributed and activated on all hosts. That made me think managing parcel is a required step when adding new hosts in API.