Support Questions

Find answers, ask questions, and share your expertise

Deployment and configuration steps with CM RestAPI not clear

avatar
New Contributor

I try to deploy and configure a CDP cluster over the CM RestAPI. However, I'm running into different problems around this. Starting with where to find values, e.g. /clusters/{clusterName}/parcels/products/{product}/versions/{version} where to find {product} and {version} for that.

Or for

curl -X POST -u admin:admin -i -H "Content-Type: application/json" -d '{ "items" : [ { "ipAddress" : "{ipAddress1}", "hostname" : "{hostname1}" }, { "ipAddress" : "{ipAddress2}", "hostname" : "{hostname2}" } ] }' http://{cmIpAddress}:7180/api/v54/clusters/{clusterName}/hosts

it returns following error although the Rest API documentation claims, that ipAddress is a required attribute

HTTP/1.1 400 Bad Request

[...]

{
"message" : "Unrecognized property: 'ipAddress'"
}

If I use the API Documentation on the CM it also does not fill out the information automatically, which would have been really helpful. 

So my question: could you provide the steps how to deploy and configure a CDP cluster with the CM Rest API that maps to the steps on the CM UI from the point the CM is installed (so starting with providing the license) up to an up and running cluster?

CM version is 7.11.3.7 and CDH is 7.1.9.9. REST API version is v54 based on the internal API documentation of the CM.

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hello @Rengaw 

Thank you for reaching out to Cloudera community

Do you have already a cluster running if yes you can export the template and import it using the below steps

 

https://docs.cloudera.com/cdp-private-cloud-base/7.1.8/configuring-clusters/topics/cdpdc-creating-ru...

 

Else you might need to follow the steps steps

https://docs.cloudera.com/cdp-private-cloud-base/7.1.8/configuring-clusters/topics/cm-api.html

The value you will need to provide manually just refer the above docs and let me know if you have any queries

Thank you

Kshitij Upadhyay

View solution in original post

3 REPLIES 3

avatar
Master Collaborator

Hello @Rengaw 

Thank you for reaching out to Cloudera community

Do you have already a cluster running if yes you can export the template and import it using the below steps

 

https://docs.cloudera.com/cdp-private-cloud-base/7.1.8/configuring-clusters/topics/cdpdc-creating-ru...

 

Else you might need to follow the steps steps

https://docs.cloudera.com/cdp-private-cloud-base/7.1.8/configuring-clusters/topics/cm-api.html

The value you will need to provide manually just refer the above docs and let me know if you have any queries

Thank you

Kshitij Upadhyay

avatar
Community Manager

@Rengaw Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.


Regards,

Diana Torres,
Senior Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
New Contributor

Hello, 

thank you for your help. We made progress. However, now we are running into an ERROR 500 when we try to POST the filled out template that we exported before. We verified again, that there is no problem with the json format and that there is no typo in the instantiator section. We did following command:

# curl -X POST -H "Content-Type: application/json" -d @cloudera.json http://admin:admin@<IP>:7182/api/v54/cm/importClusterTemplate?addRepositories=true

Warning: Couldn't read data from file "cloudera.json", this makes an
Warning: empty POST.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 Error processing POST request. Check the system logs for more information.</title>
</head>
<body><h2>HTTP ERROR 500 Error processing POST request. Check the system logs for more information.</h2>
<table>
<tr><th>URI:</th><td>/api/v54/cm/importClusterTemplate</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>Error processing POST request. Check the system logs for more information.</td></tr>
<tr><th>SERVLET:</th><td>com.cloudera.server.common.AgentAvroServlet-70ce31c3</td></tr>
</table>
</body>
</html>

and following traceback in the log:

2025-07-09 15:14:22,469 ERROR agentServer-55:com.cloudera.server.common.AgentAvroServlet: Error processing Avro request
java.io.IOException: Unexpected length: -16843009, max: 10485760
at com.cloudera.enterprise.SafeAvroHttpTransceiver.checkLength(SafeAvroHttpTransceiver.java:139)
at com.cloudera.enterprise.SafeAvroHttpTransceiver.readBuffers(SafeAvroHttpTransceiver.java:96)
at com.cloudera.server.common.HttpConnectorServer$FunctionsImpl.read(HttpConnectorServer.java:118)
at com.cloudera.server.common.HttpConnectorServer$FunctionsImpl.read(HttpConnectorServer.java:110)
at com.cloudera.server.common.AgentAvroServlet.doPost(AgentAvroServlet.java:90)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:554)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:516)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
at com.cloudera.server.common.MovingStats$1.get(MovingStats.java:32)
at com.cloudera.server.common.MovingStats$1.get(MovingStats.java:29)
at com.cloudera.server.common.MovingStats.measure(MovingStats.java:41)
at com.cloudera.server.common.MovingStats.measure(MovingStats.java:29)
at com.cloudera.server.common.MonitoringThreadPool$RunnableImpl.run(MonitoringThreadPool.java:135)
at com.cloudera.server.common.BoundedQueuedThreadPool$2.run(BoundedQueuedThreadPool.java:94)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
at java.lang.Thread.run(Thread.java:750)

We also tried the command without an "@" in front of the json file argument with following result: 

# curl -X POST -H "Content-Type: application/json" -d /tmp/cloudera.json http://admin:admin@<IP>:7182/api/v54/cm/importClusterTemplate?addRepositories=true

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 Error processing POST request. Check the system logs for more information.</title>
</head>
<body><h2>HTTP ERROR 500 Error processing POST request. Check the system logs for more information.</h2>
<table>
<tr><th>URI:</th><td>/api/v54/cm/importClusterTemplate</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>Error processing POST request. Check the system logs for more information.</td></tr>
<tr><th>SERVLET:</th><td>com.cloudera.server.common.AgentAvroServlet-70ce31c3</td></tr>
</table>
</body>
</html>

and following error in the logs:

2025-07-09 14:18:12,393 ERROR agentServer-57:com.cloudera.server.common.AgentAvroServlet: Error processing Avro request
java.io.IOException: Unexpected length (too long): 796159344, max:10485760
        at com.cloudera.enterprise.SafeAvroHttpTransceiver.checkLength(SafeAvroHttpTransceiver.java:137)
        at com.cloudera.enterprise.SafeAvroHttpTransceiver.readBuffers(SafeAvroHttpTransceiver.java:96)
        at com.cloudera.server.common.HttpConnectorServer$FunctionsImpl.read(HttpConnectorServer.java:118)
        at com.cloudera.server.common.HttpConnectorServer$FunctionsImpl.read(HttpConnectorServer.java:110)
        at com.cloudera.server.common.AgentAvroServlet.doPost(AgentAvroServlet.java:90)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
[...]

 

My colleague and I do not see, where we could have made a mistake. What can be the cause of this?
Thanks for your help!