Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

Custom service and changing configuration of 'included' hbase-site.xml

Contributor

Hi,

I'm trying to add an additional regionserver to a (HBase) cluster. I have the following metainfo.xml

<metainfo>
    <schemaVersion>2.0</schemaVersion>
    <services>
        <service>
            <name>RS_HBASE_01</name>
            <displayName>RS-HBASE-01</displayName>
            <comment>Additional Regionserver on a host</comment>
            <version>1.1.2</version>
            <components>
                <component>
                    <name>RS_HBASE_01</name>
                    <displayName>RS-01</displayName>
                    <category>SLAVE</category>
                    <cardinality>1+</cardinality>
                    <versionAdvertised>true</versionAdvertised>
                    <decommissionAllowed>true</decommissionAllowed>
                    <!-- the default category used to store generated metrics data -->
                    <timelineAppid>HBASE</timelineAppid>
                    <!-- the list of components that this component depends on -->
                    <dependencies>
                        <dependency>
                            <name>HBASE/HBASE_MASTER</name>
                            <scope>cluster</scope>
                            <auto-deploy>
                                <enabled>true</enabled>
                                <!--<co-locate>HBASE/HBASE_MASTER</co-locate>-->
                            </auto-deploy>
                        </dependency>
                        <dependency>
                            <name>HBASE/HBASE_REGIONSERVER</name>
                            <scope>host</scope>
                            <auto-deploy>
                                <enabled>true</enabled>
                            </auto-deploy>
                        </dependency>
                    </dependencies>
                    <commandScript>
                        <script>scripts/hbase_regionserver.py</script>
                        <scriptType>PYTHON</scriptType>
                        <timeout>1200</timeout>
                    </commandScript>
                    <bulkCommands>
                        <displayName>RegionServers</displayName>
                        <!-- Used by decommission and recommission -->
                        <masterComponent>HBASE/HBASE_MASTER</masterComponent>
                    </bulkCommands>
                    <logs>
                        <log>
                            <logId>hbase_regionserver01</logId>
                            <primary>true</primary>
                        </log>
                    </logs>
                </component>
            </components>
            <commandScript>
                <script>scripts/service_check.py</script>
                <scriptType>PYTHON</scriptType>
                <timeout>300</timeout>
            </commandScript>
            <!-- what other services that should be present on the cluster -->
            <requiredServices>
                <service>ZOOKEEPER</service>
                <service>HDFS</service>
                <service>HBASE</service>
            </requiredServices>
            <!-- configuration files that are expected by the service (config files owned by other services are specified in this list) -->
            <configuration-dependencies>
                <config-type>core-site</config-type> <!-- hbase puts core-site in it's folder -->
                <config-type>hbase-policy</config-type>
                <config-type>hbase-site</config-type>
                <config-type>hbase-env</config-type>
                <config-type>hbase-log4j</config-type>
            </configuration-dependencies>

        </service>
    </services>
</metainfo>

where I define my required services, and also the configuration files I need from the other services.

The installation itself works already, all files/symlinks are created and put into their directoy.

But in order to successfully start up I need some configuration values changed, e.g. hbase.regionserver.port and hbase.regionserver.info.port (within hbase-site.xml) , PID file location, log-file name etc (within hbase-env.sh) .

How can I change the values in the configuration files?

I suppose there is some helper method where I can read the configuration file before starting, and change the values.

Thanks for your suggestions.

1 ACCEPTED SOLUTION

Contributor

I (kind of) managed to change the files when they get copied during installation, and I'm changing the files after the copy via python.

Anyhow, I'm having another issue now, see my question:

https://community.hortonworks.com/questions/115875/unable-to-determine-stack-version-for-custom-serv...

Thanks

View solution in original post

3 REPLIES 3

Explorer

The Set Up Apache HBase Configuration Files section of the HDP Command-Line Installation Guide might be of some help. Some of the properties related to RegionServers are documented there.

Contributor

Thanks for the hint, but I'm looking for a way to change settings of the copied hbase-site.xml and hbase-env.sh file, before it gets started, via python.

Contributor

I (kind of) managed to change the files when they get copied during installation, and I'm changing the files after the copy via python.

Anyhow, I'm having another issue now, see my question:

https://community.hortonworks.com/questions/115875/unable-to-determine-stack-version-for-custom-serv...

Thanks