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.

Query region server port through slider REST API

Solved Go to solution

Query region server port through slider REST API

Explorer

I am using hbase 0.98 and slider 0.81.1

I want to be able to use slider REST APIs to get port number for region server instances deployed through slider. I assume the API to use is https://inldmqarh71n2:8090/proxy/application_1467115608017_0178/ws/v1/slider/publisher/exports/serve...

However, I get NullPointerException when I issue this API call. Do I need to specify anything specific in metaInfo.xml to make this work? Or is it slider version issue?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Query region server port through slider REST API

Rising Star

I don't think the default hbase app package will allow you to get the region server ports through the REST API because Slider is not allocating those ports. The port is set to 0 in the hbase-site config, so hbase will pick a random port itself. If you wanted Slider to allocate the port instead, you might be able to change the hbase.regionserver.port property to the following in the appConfig:

"site.hbase-site.hbase.regionserver.port": "${HBASE_REGIONSERVER.ALLOCATED_PORT}{PER_CONTAINER}",

You would also have to add componentExports to the HBASE_REGIONSERVER component in the metainfo.xml file:

      <component>
        <name>HBASE_REGIONSERVER</name>
        <componentExports>
          <componentExport>
            <name>regionservers</name>
            <value>${THIS_HOST}:${site.hbase-site.hbase.regionserver.port}</value>
          </componentExport>
        </componentExports>
        ...

You should then be able to access this information through /ws/v1/slider/publisher/slider/componentinstancedata

4 REPLIES 4

Re: Query region server port through slider REST API

Can you share the full exception trace, please? I'm not 100% sure, but I don't recall us shipping a version of HDP with 0.98 HBase and 0.81.1 Slider. Are you using HDP-created artifacts to run HBase on Slider?

Re: Query region server port through slider REST API

Rising Star

I don't think the default hbase app package will allow you to get the region server ports through the REST API because Slider is not allocating those ports. The port is set to 0 in the hbase-site config, so hbase will pick a random port itself. If you wanted Slider to allocate the port instead, you might be able to change the hbase.regionserver.port property to the following in the appConfig:

"site.hbase-site.hbase.regionserver.port": "${HBASE_REGIONSERVER.ALLOCATED_PORT}{PER_CONTAINER}",

You would also have to add componentExports to the HBASE_REGIONSERVER component in the metainfo.xml file:

      <component>
        <name>HBASE_REGIONSERVER</name>
        <componentExports>
          <componentExport>
            <name>regionservers</name>
            <value>${THIS_HOST}:${site.hbase-site.hbase.regionserver.port}</value>
          </componentExport>
        </componentExports>
        ...

You should then be able to access this information through /ws/v1/slider/publisher/slider/componentinstancedata

Re: Query region server port through slider REST API

Explorer

Hi @billie - Thanks. Actually, I was able to get that part working (and yes, the changes are needed both in appConfig as well as metainfo). However, when there are more than 1 region servers started on the same host (different ports), then slider gives wrong info about the port of 1st region server. Other region server ports are correct. I think that should be a bug in slider.

Re: Query region server port through slider REST API

Rising Star

Thanks for trying it out! It does sound like a Slider bug if it isn't working for multiple containers on the same host. You're welcome to open a ticket at https://issues.apache.org/jira/browse/SLIDER, or I can do that for you.

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