Created on 03-17-2017 10:25 AM - edited 09-16-2022 04:16 AM
While attempting to apply a host template, I keep running into this error/notification:
Host must have a single version of CDH installed
I didn't notice multiple cm agents running on the host, is there anything else I need to check?
Thanks!
Created 10-24-2017 04:48 AM
Hi buntu,
Apart from having the CM Agent service running - did you send a parcel to the host? (This is done by Adding to cluster)
Below API endpoint should be called with POST
/clusters/{{ cluster }}/hosts
and payload:
{'items': ['my_node_fqdn', 'other_node_fqdn'] }
Hopes this helps others.
Created 03-19-2020 10:14 AM
Thank You. This worked for me.
Created 10-25-2018 02:53 AM
Hello,
In my case, I'm trying to deploy a new host with Cloudera CM Api (suing Python). All runs good, but when I want to apply a host template, I'm receiving this error:
ApiException: Host must have a single version of CDH installed. (error 400)
I know that Cloudera automatically dsitribute and activate parcels to new host, but how can I do, in teh same code, to recognize that the activation completes and then run apply host template?
Parcel state is Activated when running, despite of is in distribution state.
Created on 10-25-2018 02:57 AM - edited 10-25-2018 02:58 AM
This is my code:
from cm_api.api_client import ApiResource, ApiException
from time import sleep
import ssl
from time import gmtime, strftime
import socket
repo_url='https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/5.15.1/'
hostnames = ["clouderapre-node3"]
hosts = []
host_password='cloudera'
parcel_version = "5.15.0-1.cdh5.15.0.p0.21"
CM_SERVER_HOST="clouderapre-mgr.fintonic.com"
cxt = ssl.create_default_context(cafile="/home/rlopez/certs/CA.crt.pem")
api = ApiResource(CM_SERVER_HOST, username="cmapi", password="B1gd4t@", use_tls=True, ssl_context=cxt)
cm = api.get_cloudera_manager()
cluster = api.get_cluster('cluster')
parcel = cluster.get_parcel('CDH', parcel_version)
template = cluster.get_host_template(name='nodo-computo')
for hostname in hostnames:
create_host = api.create_host(hostname, hostname, socket.gethostbyname(hostname), "/default")
hosts.append(create_host)
install_cm_agent = cm.host_install(user_name='root', host_names=[hostname], cm_repo_url=repo_url, password=host_password, )
while install_cm_agent.success == None:
sleep(5)
install_cm_agent = install_cm_agent.fetch()
if install_cm_agent.success != True:
print "cm_host_install failed: " + install_cm_agent.resultMessage
exit(0)
sleep(60)
for host in hosts:
hostId = [host.hostId]
add_host = cluster.add_hosts(hostId)
install_template = template.apply_host_template(host_ids=hostId, start_roles=True)
while install_template.resultMessage == "ApiException: Host must have a single version of CDH installed. (error 400)":
sleep(5)
install_template = template.apply_host_template(host_ids=hostId, start_roles=True).wait()
exit(0)
Created 11-23-2018 10:47 AM
Facing similar issue, did you get any solution yet?
Regards,
Smith
Created 12-22-2018 09:48 AM
Hi, Do you have a solution for this?
Created 06-17-2020 06:51 PM
Hi,
From my point of view, during the time the CDH parcels packages are syncing, the below info is the summary size of parcels directory, it may last some time which depend your rate of network transport, after it's finished you can continue your next work like apply service template on hosts.
2.7G /opt/cloudera/parcels
Cheers,
Hua