Hey Gaurav,

You need to have keytab and principal. Additionally, the configuration
files of cluster should be present in classpath of your app.

Please find below the sample code to create a configuration object for a
secure cluster:

   * @param keytab location of the keytab file
   * @param principal Kerberos principal
   * @return Configuration that can be used to create HConnection or HTable
for a secure HBase cluster.
  public static Configuration getHBaseConfiguration(String keytab, String
principal) {
    // create the type of object we will return from this function

    Configuration conf = HBaseConfiguration.create();

    // security
    conf.set("hbase.myclient.keytab", keytab);
    conf.set("hbase.myclient.principal", principal);
    try {
      User.login(conf, "hbase.myclient.keytab", "hbase.myclient.principal",
    } catch (IOException e) {
      // TODO Auto-generated catch block
    return conf;
On Thu, May 8, 2014 at 3:06 AM, Gaurav Thakur <[EMAIL PROTECTED]> wrote:

Thanks & Regards,
Anil Gupta

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB