hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pete Haidinyak" <javam...@cox.net>
Subject Re: HBase Client connect to remote HBase
Date Thu, 23 Dec 2010 07:45:17 GMT
Hi,
	Here is the code I use to connect to a remote HBase. You'll note most of  
the connection information is in the m_configuration.set methods.


   /**
    * Method setupHBaseConnection
    *
    * If production has a problem connecting make sure the
    * hbase-0.89.20100924+28-tests.jar is not in the Classpath.
    *
    * @throws IOException when there is a connection problem to the HBase  
Cluster.
    */
   private void setupHBaseConnection()
     throws IOException
   {
     m_configuration = HBaseConfiguration.create();
     m_configuration.clear();

// - Get the configuration properties from the Command line -D parameters.
     m_configuration.set("hbase.zookeeper.quorum",
                         System.getProperty("hbase.zookeeper.quorum",  
"caiss01a,caiss01b"));
     m_configuration.set("hbase.zookeeper.property.clientPort",
                         System.getProperty("hbase.zookeeper.property.clientPort",  
"2222"));

     m_trafficTable = new HTable(m_configuration, TRAFFIC_LOG_TABLE_NAME);

     m_logger.info("Connection successful.");

   } // - End setupHBaseConnection Method.




On Wed, 22 Dec 2010 22:57:23 -0800, King JKing <beuking@gmail.com> wrote:

> Dear all,
>
> I set up my HBase server in standalone mode.
>
> Can HBase Client (from another machine) connect to this HBase server?
> How can I do that?
>
> A lot of people have the same question. But I did not find correct  
> answer.
>
> Thank a lot for support.


Mime
View raw message