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="172.16.5.84";
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-tp29223571p29223571.html
Sent from the HBase User mailing list archive at Nabble.com.