Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Cloudera importClusterTemplate - host(s) are not available

Highlighted

Cloudera importClusterTemplate - host(s) are not available

New Contributor

I got "host(s) are not available" error while importing a cluster template into a CDH6 cluster. Would someone help to explain what I did wrong for the template?

# curl -X POST -H "Content-Type: application/json" -d @cdh-template.json 
http://admin:admin@manager.hadoop.com:7180/api/v12/cm/importClusterTemplate
{
  "message" : "The following host(s) are not available: 
node2.hadoop.com,node3.hadoop.com,node1.hadoop.com."

The hosts are actually exist via the hosts api

# curl -u admin:admin "http://manager.hadoop.com:7180/api/v12/hosts" | grep hostname
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
100  3210    0  3210    0     0   123k      0 --:--:-- --:--:-- --:--:--  125k
    "hostname" : "node1.hadoop.com",
    "hostname" : "node2.hadoop.com",
    "hostname" : "node3.hadoop.com",

Part of the template file:

   "hostTemplates" : [ {
   "refName" : "HostTemplate-0-from-node1.hadoop.com",
   "cardinality" : 1,
   "roleConfigGroupsRefNames" : [ "hdfs-BALANCER-BASE", "hdfs-FAILOVERCONTROLLER-BASE", "hdfs- 
   JOURNALNODE-BASE", "hdfs-NAMENODE-1", "hive-GATEWAY-BASE", "impala-CATALOGSERVER-BASE", "impala- 
   STATESTORE-BASE", "yarn-JOBHISTORY-BASE", "yarn-RESOURCEMANAGER-BASE", "zookeeper-SERVER-BASE" ]
   }, {
   "refName" : "HostTemplate-2-from-node2.hadoop.com",
   "cardinality" : 1,
   "roleConfigGroupsRefNames" : [ "hdfs-DATANODE-BASE", "hdfs-FAILOVERCONTROLLER-BASE", "hdfs- 
   JOURNALNODE-BASE", "hdfs-NAMENODE-1", "hive-GATEWAY-BASE", "hive-HIVEMETASTORE-BASE", "hive- 
   HIVESERVER2-BASE", "impala-IMPALAD-1", "yarn-NODEMANAGER-1", "zookeeper-SERVER-BASE" ]
   }, {
   "refName" : "HostTemplate-3-from-node3.hadoop.com",
   "cardinality" : 1,
   "roleConfigGroupsRefNames" : [ "hdfs-DATANODE-BASE", "hdfs-JOURNALNODE-BASE", "hive-GATEWAY- 
   BASE", "impala-IMPALAD-BASE", "yarn-NODEMANAGER-BASE", "zookeeper-SERVER-BASE" ]
   } ],
   "instantiator" : {
       "clusterName" : "cdh631",
       "hosts" : [ {
          "hostName" : "node1.hadoop.com",
          "hostTemplateRefName" : "HostTemplate-0-from-node1.hadoop.com"
        }, {
          "hostName" : "node2.hadoop.com",
          "hostTemplateRefName" : "HostTemplate-2-from-node2.hadoop.com"
        }, {
          "hostName" : "node3.hadoop.com",
          "hostTemplateRefName" : "HostTemplate-3-from-node3.hadoop.com"
        }],

Thanks a lot.

2 REPLIES 2

Re: Cloudera importClusterTemplate - host(s) are not available

Super Collaborator

Hi @kguan ,

 

What is your Cloudera Manager version? I see you are using API v12 which is pretty old version (for CM5.7.x). Please check this and see if you should switch to use different API version:

https://cloudera.github.io/cm_api/docs/releases/

 

Thanks and hope this helps,

Li

Li Wang, Technical Solution Manager


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:

Terms of Service

Community Guidelines

How to use the forum

Highlighted

Re: Cloudera importClusterTemplate - host(s) are not available

New Contributor

Thanks @lwang for the information. I'm using Cloudera Manager 6.3.1 and followed the importClusterTemplate command in the page Importing the Template to a New Cluster.

 

But anyway, I got the same error after updated to v33 according to the page you provided:

[root@manager ~]# curl -X POST -H "Content-Type: application/json" -d @cdh63-template.json http://admin:admin@manager.hadoop.com:7180/api/v33/cm/importClusterTemplate
{
"message" : "The following host(s) are not available: node1.hadoop.com,node2.hadoop.com,node3.hadoop.com."

 

In the cloudera-scm-server.log, it returned a status 400 error:

2020-02-25 16:01:32,447 INFO scm-web-453:com.cloudera.api.ApiExceptionMapper: Exception caught in API invocation. Msg:The following host(s) are not available: node1.hadoop.com,node2.hadoop.com,node3.hadoop.com.
java.lang.IllegalArgumentException: The following host(s) are not available: node1.hadoop.com,node2.hadoop.com,node3.hadoop.com.
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
        at com.cloudera.api.dao.impl.ClouderaMasterServerDaoImpl.validateAndPrepareContext(ClouderaMasterServerDaoImpl.java:292)
        at com.cloudera.api.dao.impl.ClouderaMasterServerDaoImpl.importClusterTemplate(ClouderaMasterServerDaoImpl.java:218)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.cloudera.api.dao.impl.ManagerDaoBase.runInNewTransaction(ManagerDaoBase.java:203)
        at com.cloudera.api.dao.impl.ManagerDaoBase.access$100(ManagerDaoBase.java:82)
        at com.cloudera.api.dao.impl.ManagerDaoBase$TransactionCallable.call(ManagerDaoBase.java:239)
        at com.cloudera.server.common.RetryWrapper.executeWithRetry(RetryWrapper.java:32)
        at com.cloudera.server.common.RetryUtils.executeWithRetryHelper(RetryUtils.java:210)
        at com.cloudera.server.common.RetryUtils.executeWithRetry(RetryUtils.java:131)
        at com.cloudera.api.dao.impl.ManagerDaoBase.runInNewTransactionWithRetry(ManagerDaoBase.java:169)
        at com.cloudera.api.dao.impl.ManagerDaoBase.invoke(ManagerDaoBase.java:272)
        at com.sun.proxy.$Proxy199.importClusterTemplate(Unknown Source)
        at com.cloudera.api.v12.impl.ClouderaManagerResourceV12Impl.importClusterTemplate(ClouderaManagerResourceV12Impl.java:216)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)
        at com.cloudera.api.ApiInvoker.invoke(ApiInvoker.java:117)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:261)
        at com.cloudera.api.ApiInvoker.invoke(ApiInvoker.java:117)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:261)
        at com.cloudera.api.ApiInvoker.invoke(ApiInvoker.java:117)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:263)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:189)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:218)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:867)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
        at com.cloudera.enterprise.JavaMelodyFacade$MonitoringFilter.doFilter(JavaMelodyFacade.java:200)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.kerberos.web.authentication.SpnegoAuthenticationProcessingFilter.doFilter(SpnegoAuthenticationProcessingFilter.java:128)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.<a href="http://www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215" target="_blank">www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:215</a>)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at com.cloudera.api.ApiBasicAuthFilter.doFilter(ApiBasicAuthFilter.java:86)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
        at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:174)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:502)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
        at com.cloudera.server.common.BoundedQueuedThreadPool$2.run(BoundedQueuedThreadPool.java:94)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:748)
2020-02-25 16:01:32,450 INFO scm-web-453:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/v33/cm/importClusterTemplate, Status:400
2020-02-25 16:10:29,465 INFO StaleEntityEviction:com.cloudera.server.cmf.StaleEntityEvictionThread: Reaped total of 0 deleted commands
2020-02-25 16:10:29,466 INFO StaleEntityEviction:com.cloudera.server.cmf.StaleEntityEvictionThread: Found no commands older than 2018-02-25T21:10:29.465Z to reap.
2020-02-25 16:10:29,466 INFO StaleEntityEviction:com.cloudera.server.cmf.StaleEntityEvictionThread: Wizard is active, not reaping scanners or configurators

 

Don't have an account?
Coming from Hortonworks? Activate your account here