Example: Run application for the 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 HBase client. The application must be run for this client from a computer which:
  • Has internal network access to the VPC in which the database is deployed
  • Can resolve the internal hostnames of the database
  • Can obtain a Kerberos ticket from the database's KDC

One of the methods to run traditional HBase client applications is to launch a "bastion host" in your cloud provider which meets the above requirements.

Ensure that you download the directory containing 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.

  1. Use clientConfigurationURL from the describe-client-connectivity response to obtain the necessary configuration clients to talk to HBase:
    $ cdp opdb describe-client-connectivity --database-name <your_database> --environment-name <your_environment>  | jq '.connectors[] | select(.name == "hbase") | .configuration.clientConfigurationUrl'
    $ curl -k -o clientConfig.zip -u '<username>:<cdp_workload_password>' https://client_Configuration_URL/.../services/hbase/clientConfig
    One method is to build your local machine and copy the JAR files to the remote node:
    $ 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: ***********
    $ java -cp target/nosql-libs/*:target/nosql-exemplar-0.0.1-SNAPSHOT.jar:hbase-conf com.cloudera.odx.nosql.Client
  3. Run your application for the HBase client.