Support Questions

Find answers, ask questions, and share your expertise

Adding another RS with a custom service


I already posted the manual steps for adding an additional RS to an existing HBase cluster (see here )

Due to the limitation that I can't manage it via Ambari I looked at the sources and other custom service definitions for a stack. the metainfo.xml file will follow below. Anyhow, when I add this to my ambari-server the server starts and I see the new service within the components list.

When I only select my new service Ambari tells me that other services are required in order to have this service running, so that's working fine. But then I get the exception:

500 status code received on GET method for API: /api/v1/stacks/HDP/versions/2.4/recommendations
  Error message: Server Error

and the ambari-server.log shows this

26 Jun 2017 14:22:49,119  WARN [qtp-ambari-client-22] ServletHandler:563 - /api/v1/stacks/HDP/versions/2.4/recommendations
    at org.apache.ambari.server.state.PropertyInfo.getAttributesMap(
    at org.apache.ambari.server.state.PropertyInfo.convertToResponse(
    at org.apache.ambari.server.controller.AmbariManagementControllerImpl.getStackConfigurations(
    at org.apache.ambari.server.controller.AmbariManagementControllerImpl.getStackConfigurations(
    at org.apache.ambari.server.controller.internal.StackConfigurationResourceProvider$1.invoke(
    at org.apache.ambari.server.controller.internal.StackConfigurationResourceProvider$1.invoke(
    at org.apache.ambari.server.controller.internal.AbstractResourceProvider.getResources(
    at org.apache.ambari.server.controller.internal.StackConfigurationResourceProvider.getResources(
    at org.apache.ambari.server.controller.internal.ClusterControllerImpl$ExtendedResourceProviderWrapper.queryForResources(
    at org.apache.ambari.server.controller.internal.ClusterControllerImpl.getResources(
    at org.apache.ambari.server.api.query.QueryImpl.doQuery(
    at org.apache.ambari.server.api.query.QueryImpl.queryForSubResources(
    at org.apache.ambari.server.api.query.QueryImpl.queryForSubResources(
    at org.apache.ambari.server.api.query.QueryImpl.queryForResources(
    at org.apache.ambari.server.api.query.QueryImpl.execute(
    at org.apache.ambari.server.api.handlers.ReadHandler.handleRequest(
    at org.apache.ambari.server.controller.internal.RecommendationResourceProvider.createResources(
    at org.apache.ambari.server.controller.internal.ClusterControllerImpl.createResources(
    at org.apache.ambari.server.api.handlers.CreateHandler.persist(
    at org.apache.ambari.server.api.handlers.BaseManagementHandler.handleRequest(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

the metainfo.xml file:

      <comment>Additional Regionservers on one host
            <!-- Used by decommission and recommission -->




      <!-- configuration files that are expected by the service (config files owned by other services are specified in this list) -->
        <config-type>core-site</config-type> <!-- hbase puts core-site in it's folder -->


I tried to set the category to SLAVE, as it basically is a SLAVE, and the master component is a HBASE_MASTER, but same error.

Any ideas what I do wrong?



Expert Contributor

@David Pocivalnik

every time recommendation API call is made, new entry for logs is made at path "/var/run/ambari-server/stack-recommendations/" on ambari-server host. there will be several and if you are not certain about the last entry then please move all historical existing entries to different location and then again go through add service wizard to produce a repro.

Entry will have stackadvisor.err and stackadvisor.out files. Please refer them for further debugging the issue. If it's not clear from logs, please compress the directory and post it on this thread, So that we can get more information for debugging purpose.


Thanks for the hint @jaimin . Attached the files from the folder , unfortunately the stackadvisor.err file is empty, so I'm not sure that helps. Maybe you see a problem?

Maybe a question for understanding: Do I have to define a MASTER component for a service, or is it ok if I only have SLAVEs? As in my case, the MASTER is the one from HBASE.

Expert Contributor

@David Pocivalnik

It is ok to have service that only has slave. Flume service is a working example for that:

There seems to be something else in the custom service that you defined which might be causing this issue. Does the new custom service has any configurations ? can you also post zip file for the custom hbase service that you are introducing ?


Thanks for the info @jaimin.

I just re-created my virtual machines, now with Ambari 2.4.0 instead of My custom service is again added to the stack definition, and now I'm able to assign masters and slaves, including my custom service. So maybe it's a problem with the 'old' version.

The error I now get is

org.apache.ambari.server.controller.spi.SystemException: An internal system exception occurred: Configuration with tag 'version1' exists for 'hbase-env'

ClusterImpl:2523 - Looking for service for config types [hbase-env]
27 Jun 2017 07:27:07,652 ERROR [ambari-client-thread-24] AbstractResourceProvider:343 - Caught AmbariException when modifying a resource
org.apache.ambari.server.AmbariException: Configuration with tag 'version1' exists for 'hbase-env'
    at org.apache.ambari.server.controller.AmbariManagementControllerImpl.createConfiguration(
    at org.apache.ambari.server.controller.AmbariManagementControllerImpl.updateCluster(
    at org.apache.ambari.server.controller.AmbariManagementControllerImpl.updateClusters(
    at org.apache.ambari.server.controller.internal.ClusterResourceProvider$2.invoke(
    at org.apache.ambari.server.controller.internal.ClusterResourceProvider$2.invoke(
    at org.apache.ambari.server.controller.internal.AbstractResourceProvider.invokeWithRetry(
    at org.apache.ambari.server.controller.internal.AbstractResourceProvider.modifyResources(
    at org.apache.ambari.server.controller.internal.ClusterResourceProvider.updateResourcesAuthorized(
    at org.apache.ambari.server.controller.internal.AbstractAuthorizedResourceProvider.updateResources(
    at org.apache.ambari.server.controller.internal.ClusterControllerImpl.updateResources(
    at org.apache.ambari.server.api.handlers.UpdateHandler.persist(
    at org.apache.ambari.server.api.handlers.BaseManagementHandler.handleRequest(

attached the configuration and package folders of my service, the metainfo didn't change (except the version, as it's 1.1.2 now)

basically I only changed some port numbers, location for log and pid file. and I removed any code regarding Windows OS.

Thanks for your help.


I was having some problem in my script, as some of the imports ain't available.

Right now I can create the intended symlink, but it's pointing to a wrong location, the original RS is like this:

hbase-regionserver -> /usr/hdp/

and mine is

hbase-regionserver-01 -> /usr/hdp/

The path for the target is created within (at the moment) looking like this:

regionserver_root_dir_specific = format("{stack_root}/{stack_version_formatted}/hbase")

So my question is: Is the {stack_version_formatted} wrong? (no change of the code, just re-using it)

or do I have to use another variable?

Thanks for your time

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.