cloudera / cm_api

Cloudera Manager API Client
Apache License 2.0
305 stars 284 forks source link

Configuring CDH, cm_api cluster.add_hosts(all_hosts) gives error stating "Host not found" ApiException #64

Open bkbasavaraju opened 6 years ago

bkbasavaraju commented 6 years ago

We are deploying CDH 5.10.0 through the Python client of cm_api in RHEL 6.8 hosted in Azure. We are receiving the following error during the configuring the CDH.

Connected to CM host on stt-mc-te.23qwyritdroeuryrw234jsdfjl.bx.internal.cloudapp.net and updated CM configuration Traceback (most recent call last): File "/data/opt/deploytmp/ConfigureCDH.py", line 1037, in main() File "/data/opt/deploytmp/ConfigureCDH.py", line 936, in main CLUSTER = init_cluster(API, CLUSTER_NAME, CDH_VERSION, CLUSTER_HOSTS, CM_HOST) File "/data/opt/deploytmp/ConfigureCDH.py", line 427, in init_cluster cluster.add_hosts(all_hosts) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/endpoints/clusters.py", line 240, in add_hosts api_version=3) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/endpoints/types.py", line 362, in _post api_version) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/endpoints/types.py", line 380, in _call api_version) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/endpoints/types.py", line 137, in call ret = method(path, data=data, params=params) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/resource.py", line 138, in post self._make_headers(contenttype)) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/resource.py", line 63, in invoke headers=headers) File "/usr/lib/python2.6/site-packages/cm_api-8.0.0-py2.6.egg/cm_api/http_client.py", line 161, in execute raise self._exc_class(ex) cm_api.api_client.ApiException: Host 'stt-mc-te.23qwyritdroeuryrw234jsdfjl.bx.internal.cloudapp.net' not found. (error 404)

We checked with reverse DNS with the below python command and it gave the required results.

python -c "import socket; print socket.getfqdn(); print socket.gethostbyname(socket.getfqdn())"

Can someone please advice what might be the issue here.

Liuzhj commented 6 years ago

hi @bkbasavaraju

in your environment, The CDH cluster is deploying on Azure VM?

cm_api.api_client.ApiException: Host 'stt-mc-te.23qwyritdroeuryrw234jsdfjl.bx.internal.cloudapp.net' not found. (error 404)

I think is the symptom for you question , you can set Public IP for your VM, and try run script again . and can you show your code here? in my company , is deploying the CDH cluster on Azure . we can learn from each other.