hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gagansnt <gagan...@gmail.com>
Subject Re: Accessing HBase conf folder from other machine
Date Wed, 21 Jul 2010 12:46:00 GMT

My problem got resolved - 
I need to have the files "hbase-site.xml" and "hbase-default.xml" on my
local system. Inside my Eclipse project to be precise. I was trying to
access the conf file present on HBase system. 

In case you want to access your conf folder on HBase server you may need to
setup some sort of web-server on the host/port and then you I can access it. 

I got hint from Jamie's answer to my question here -
Thanks Jamie. 


gagansnt wrote:
> I have written a simple Java application to use functionality provided by
> HBaseAdmin class. When I am running my application on master machine works
> well. following is the code to access config files- 
> HBaseConfiguration config = new HBaseConfiguration();
> config.addResource(new Path("/opt/habse-0.20.4/conf/hbase-site.xml"));
> config.addResource(new Path("/opt/habse-0.20.4/conf/hbase-default.xml"));
> Problem is when I try to connect from other machine then I am unable to
> read these configurations. I am using following code - 
> private final String host="";
> private final int port=2181;
> private final String protocol = "http";
> HBaseConfiguration config = new HBaseConfiguration();
> config.addResource(new
> URL(protocol,host,port,/opt/habse-0.20.4/conf/hbase-site.xml)); 
> config.addResource(new
> URL(protocol,host,port,/opt/habse-0.20.4/conf/hbase-default.xml));
> I am getting exception - 
> FATAL conf.Configuration: error parsing conf file:
> java.net.SocketException: Unexpected end of file from server
> Exception in thread "main" java.lang.RuntimeException:
> java.net.SocketException: Unexpected end of file from server
> 	at
> org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1162)
> 	at
> org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1040)
> 	at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:980)
> 	at org.apache.hadoop.conf.Configuration.iterator(Configuration.java:1016)
> 	at
> org.apache.hadoop.hbase.HBaseConfiguration.hashCode(HBaseConfiguration.java:63)
> 	at java.util.HashMap.getEntry(HashMap.java:344)
> 	at java.util.LinkedHashMap.get(LinkedHashMap.java:280)
> 	at
> org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:116)
> 	at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:68)
> 	at net.smithmicro.hbase.JHBaseAdmin.initConfig(JHBaseAdmin.java:55)
> 	at net.smithmicro.hbase.JHBaseAdmin.main(JHBaseAdmin.java:40)
> Not sure I am missing anything. Kindly help me out. 
> Thanks in advance. 
> Gagan

View this message in context: http://old.nabble.com/Accessing-HBase-conf-folder-from-other-machine-tp29223571p29225277.html
Sent from the HBase User mailing list archive at Nabble.com.

View raw message