Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Query region server port through slider REST API

avatar
Rising Star

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

avatar
Expert Contributor

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

View solution in original post

4 REPLIES 4

avatar
Super Guru

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?

avatar
Expert Contributor

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

avatar
Rising Star

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.

avatar
Expert Contributor

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.