Example: run an application for the Apache HBase client

Checking the example of how to run a Maven application for the HBase client gives you better understanding about how to run your own application for the HBase client.

The requiredKerberos option is set to true for the Apache HBase client. The application must be run for this client from a computer which:
  • Has internal network access to the public cloud in which the database is deployed
  • Can resolve the internal hostnames of the database
  • Can obtain a Kerberos ticket from the database's Kerberos Key Distribution Center (KDC)

One way to run the Apache HBase client applications is to launch an edge node in your cloud provider which meets the above requirements.

Ensure that you download the directory containing the Apache HBase client configuration files from clientConfigurationUrl provided in describe-client-connectivity response. This is a protected endpoint, and you have to use your CDP workload credentials to access this endpoint. You can also get the Apache HBase client configuration as a client tarball from the COD database web user interface Connect tab.

  1. Use clientConfigurationURL from the describe-client-connectivity response to obtain the necessary configuration details to communicate with Apache HBase:
    $ cdp opdb describe-client-connectivity --database-name [***YOUR DATABASE NAME***] --environment-name [***YOUR ENVIRONMENT NAME***]  | jq '.connectors[] | select(.name == "hbase") | .configuration.clientConfigurationUrl'
    "https://client_Configuration_URL/.../services/hbase/clientConfig"
    $ curl -k -o clientConfig.zip -u '[***USERNAME***]:[***CDP WORKLOAD PASSWORD***]' https://client_Configuration_URL/.../services/hbase/clientConfig
    
    You can build the application in your local machine and copy the JAR files to the remote node using the following commands:
    $ scp -r target ec2-user@my-ec2-bastion-host.us-west-2.compute.amazonaws.com:
    $ scp clientConfig.zip ec2-user@my-ec2-bastion-host.us-west-2.compute.amazonaws.com:
    $ ssh ec2-user@my-ec2-bastion-host.us-west-2.compute.amazonaws.com "sudo yum install -y java-1.8.0-openjdk"
    $ ssh ec2-user@my-ec2-bastion-host.us-west-2.compute.amazonaws.com "unzip clientConfig.zip"
    
  2. Ensure that you have a Kerberos ticket:
    $ kinit [***USERNAME***] Password: [***PASSWORD***]
    $ java -cp target/nosql-libs/*:target/nosql-exemplar-0.0.1-SNAPSHOT.jar:hbase-conf com.cloudera.odx.nosql.Client
    
  3. Run your application.