Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HBase, mail # dev - help needed towards connecting Hbase


+
jeevi tesh 2014-01-31, 07:52
+
Ted Yu 2014-01-31, 09:07
+
jeevi tesh 2014-01-31, 10:08
+
ramkrishna vasudevan 2014-01-31, 10:20
+
jeevi tesh 2014-01-31, 10:51
+
ramkrishna vasudevan 2014-01-31, 11:24
+
jeevi tesh 2014-01-31, 11:35
+
ramkrishna vasudevan 2014-01-31, 11:45
+
jeevi tesh 2014-01-31, 12:24
+
Sukumar Maddineni 2014-01-31, 14:17
+
jeevi tesh 2014-01-31, 14:43
+
jeevi tesh 2014-01-31, 14:47
+
jeevi tesh 2014-01-31, 16:04
+
jeevi tesh 2014-01-31, 16:13
+
jeevi tesh 2014-02-01, 09:07
Copy link to this message
-
Re: help needed towards connecting Hbase
Jean-Marc Spaggiari 2014-02-01, 09:41
Seem you have some bad information in config file or ZK. Can you confirm
again which HBase version you use? I'm not able to find HServerAddress in
0.96.x...
JM
2014-02-01 jeevi tesh <[EMAIL PROTECTED]>:

> hi,
> I changed the etc/hosts file now it looks like
> 127.0.0.1              localhost.localdomain.com          localhost
> 192.168.1.42              database.companyname.com      database
>
> I'm able to connect "http://192.168.1.42:60010/master-status?filter=all"
> and also to hbase shell and after issue of command "status" i get
> 1 server, 3 dead, 3.000 average load.
>
> There are no error but* no tables are getting created.*
> *Any suggestion or comments will be of great help.*
>
> *Hadoop and Hbase are in oracle linux os on completely different Vm.*
> *I'm connecting from my win7 machine through my java code.*
>
>
> *One interesting thing is if uncomment
> line*"HBaseAdmin.checkHBaseAvailable(config);
> "
> I get error
> 14/02/01 14:33:27 INFO zookeeper.ClientCnxn: Socket connection established
> to 192.168.1.42/192.168.1.42:2181, initiating session
> 14/02/01 14:33:27 INFO zookeeper.ClientCnxn: Session establishment complete
> on server 192.168.1.42/192.168.1.42:2181, sessionid = 0x143eca016d60010,
> negotiated timeout = 40000
> java.lang.NumberFormatException: For input string: "43535???]M??PBUF
> $
>  database.unilogcorp.com ??  ????(
>
> at
>
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Integer.parseInt(Integer.java:458)
> at java.lang.Integer.parseInt(Integer.java:499)
> at org.apache.hadoop.hbase.HServerAddress.<init>(HServerAddress.java:63)
> at
>
> org.apache.hadoop.hbase.MasterAddressTracker.getMasterAddress(MasterAddressTracker.java:63)
> at
>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:353)
> at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:89)
> at
>
> org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:1216)
> at pack1.testDB.main(testDB.java:30)
>
> below is my new script
> package pack1;
>
> import java.io.IOException;
>
> import org.apache.hadoop.conf.Configuration;
> import org.apache.hadoop.fs.Path;
> import org.apache.hadoop.hbase.HBaseConfiguration;
> import org.apache.hadoop.hbase.client.HBaseAdmin;
> import org.apache.hadoop.hbase.client.HTable;
> import org.apache.hadoop.hbase.client.Put;
> import org.apache.hadoop.hbase.util.Bytes;
>
> public class testDB {
>
> /**
>  * @param args
>  */
> public static void main(String[] args) {
> try {
> System.out.println("1 Before HBASE COnfiguration");
> Configuration config = HBaseConfiguration.create();
> config.clear();
> System.out.println("2 Before HBASE COnfiguration");
> //config.addResource(new Path("conf/hbase-site.xml"));
> System.setProperty("java.net.preferIPv4Stack" , "true");
> config.set("hbase.master", "192.168.1.42:60010");
> config.set("hbase.zookeeper.quorum", "192.168.1.42");
> config.set("hbase.zookeeper.property.clientPort","2181");
>  //HBaseAdmin.checkHBaseAvailable(config);
> System.out.println("HBase is running!");
>         HTable table;
>
>         table = new HTable(config, "test4");
>
>
>             System.out.println("Table mytable obtained ");
>
>          Put put = new Put(Bytes.toBytes("row1"));
>
>
> put.add(Bytes.toBytes("colfam1"),Bytes.toBytes("qual1"),Bytes.toBytes("val1"));
>
>
> put.add(Bytes.toBytes("colfam1"),Bytes.toBytes("qual2"),Bytes.toBytes("val2"));
>             table.put(put);
>            // table.close();
>
> } catch (Exception e) {
>  e.printStackTrace();
> }
>
> }
>
> }
> Output is as follows
> 1 Before HBASE COnfiguration
> 2 Before HBASE COnfiguration
> HBase is running!
> 14/02/01 14:22:59 INFO zookeeper.ZooKeeper: Client
> environment:zookeeper.version=3.3.2-1031432, built on 11/05/2010 05:32 GMT
> 14/02/01 14:22:59 INFO zookeeper.ZooKeeper: Client environment:host.name
> =DELL-75.unilog
> 14/02/01 14:22:59 INFO zookeeper.ZooKeeper: Client

 
+
jeevi tesh 2014-02-01, 09:52
+
jeevi tesh 2014-02-01, 10:00
+
jeevi tesh 2014-02-03, 06:16
+
jeevi tesh 2014-02-03, 07:32