Java Operation HBase Error Record

Source: Internet
Author: User

Introduction Environment:

WINDOW7 x64

Eclipse Java EE IDE for WEB developers. (Version:kepler Service Release 1) (Build id:20130919-0819)

HBase (hbase-0.98.3-hadoop2-bin.tar.gz)

Error content: (Partially used by me "..." instead of, some computer information)

12014-09-02 15:39:22,900 WARN [main] util. Nativecodeloader (nativecodeloader.java:<clinit>)-Unable to loadnative-hadoop Library forYour platform ... using builtin-Java classes where applicable22014-09-02 15:39:23,091 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:zookeeper.version=3.4.6-1569965, built on 02/20/2014 09:09GMT32014-09-02 15:39:23,091 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:host.name="..."42014-09-02 15:39:23,091 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:java.version=1.7. 0_6052014-09-02 15:39:23,091 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:java.vendor=Oracle Corporation62014-09-02 15:39:23,091 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:java.home="..."72014-09-02 15:39:23,091 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client Environment:java.class. path="..."82014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:java.library.path="..."92014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:java.io.tmpdir="..."Ten2014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:java.compiler=<na> One2014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:os.name=windows 7 A2014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:os.arch=AMD64 -2014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:os.version=6.1 -2014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:user.name="..." the2014-09-02 15:39:23,092 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:user.home="..." -2014-09-02 15:39:23,093 INFO [main] zookeeper. ZooKeeper (ENVIRONMENT.JAVA:LOGENV)-Client environment:user.dir="..." -2014-09-02 15:39:23,095 INFO [main] zookeeper. ZooKeeper (zookeeper.java:<init> (438))-Initiating client connection, connectstring=192.168.0.210:2181 sessiontimeout=90000 Watcher=hconnection-0x4bc2fdde, quorum=192.168.0.210:2181, baseZNode=/HBase -2014-09-02 15:39:23,128 INFO [main] zookeeper. Recoverablezookeeper (recoverablezookeeper.java:<init>)-Process Identifier=hconnection-0x4bc2fdde Connecting to ZooKeeper ensemble=192.168.0.210:2181 +2014-09-02 15:39:23,128 INFO [Main-sendthread (192.168.0.210:2181)] zookeeper. Clientcnxn (ClientCnxn.java:logStartConnect (975))-Opening socket connection to server 192.168.0.210/ 192.168.0.210:2181. Won't attempt to authenticate using SASL (unknown error) -2014-09-02 15:39:23,131 INFO [Main-sendthread (192.168.0.210:2181)] zookeeper. Clientcnxn (ClientCnxn.java:primeConnection (852))-Socket connection established to 192.168.0.210/192.168.0.210:2181, initiating session +2014-09-02 15:39:23,173 INFO [Main-sendthread (192.168.0.210:2181)] zookeeper. Clientcnxn (ClientCnxn.java:onConnected (1235))-Session establishment complete on server 192.168.0.210/ 192.168.0.210:2181, SessionID = 0x1481be77ced001a, negotiated timeout = 40000 A2014-09-02 15:39:23,414 INFO [main] Configuration.deprecation (Configuration.java:warnOnceIfDeprecated (840))-Hadoop .native. Lib is deprecated. Instead, use IO.native. Lib.available at2014-09-02 15:39:26,188 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-getmaster attempt 1 of 35 Failed Retrying after sleep of exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:39:26,320 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 2 of 35 Failed Retrying after sleep of 201, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:39:26,636 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-getmaster attempt 3 of 35 Failed Retrying after sleep of 302, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:39:27,143 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 4 of 35 Failed Retrying after sleep of $, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:39:28,075 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-getmaster attempt 5 of 35 Failed Retrying after sleep of 1004, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:39:29,084 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 6 of 35 Failed Retrying after sleep of exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas in2014-09-02 15:39:31,098 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 7 of 35 Failed Retrying after sleep of 4014, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:39:35,120 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 8 of 35 Failed Retrying after sleep of 10005, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas to2014-09-02 15:39:47,690 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 9 of 35 Failed Retrying after sleep of 10097, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas +2014-09-02 15:40:00,349 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt of 35 Failed Retrying after sleep of 10043, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:40:12,956 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt all 35 Failed Retrying after sleep of 10057, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas the2014-09-02 15:40:25,777 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 35 of Failed Retrying after sleep of 20096, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas *2014-09-02 15:40:48,656 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 35 Failed Retrying after sleep of 20146, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas $2014-09-02 15:41:11,363 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 35 Failed Retrying after sleep of 20174, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:masPanax Notoginseng2014-09-02 15:41:34,114 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 35 of Failed Retrying after sleep of 20096, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas -2014-09-02 15:41:57,174 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 35 Failed Retrying after sleep of 20160, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas the2014-09-02 15:42:19,894 INFO [main] client. Hconnectionmanager$hconnectionimplementation (HConnectionManager.java:makeStub (1637))-Getmaster attempt 35 Failed Retrying after sleep of 20198, exception=Com.google.protobuf.ServiceException:java.net.UnknownHostException:unknown Host:mas + ...... May still be running

The Java code is as follows: (I added the jar packages under Hbase-0.98.3-hadoop2\lib in HBase to the project)

Importorg.apache.hadoop.conf.Configuration;Importorg.apache.hadoop.hbase.HBaseConfiguration;ImportOrg.apache.hadoop.hbase.HColumnDescriptor;ImportOrg.apache.hadoop.hbase.HTableDescriptor;ImportOrg.apache.hadoop.hbase.TableName;Importorg.apache.hadoop.hbase.client.HBaseAdmin; Public classHbasetest { Public Static voidMain (string[] agrs)throwsException {String strtbname= "Tb_test";//TableString strcolfamily = "CF";//Column Family//ConfigurationConfiguration conf =hbaseconfiguration.create (); Conf.set ("Hbase.zookeeper.quorum", ""This is the IP value of master""); //AdministratorHbaseadmin hbaseadmin =Newhbaseadmin (conf); //Table nameTableName TableName =tablename.valueof (strtbname); //Table DescriptorHtabledescriptor Tabledesc =NewHtabledescriptor (tableName); Tabledesc.addfamily (NewHcolumndescriptor (strcolfamily));//Add Column Family//Create a table, synchronize operationshbaseadmin.createtable (TABLEDESC); System.out.println ("CREATE TABLE" + Strtbname + "Success"); }}

First of all, I read this article: http://javacrazyer.iteye.com/blog/1186881

Which reviews 11 floor: (mine is based on my own configuration)

11/F Sujianhu 2014-04-23I also met13/07/05 19:50:05 INFO Zookeeper. Clientcnxn:opening socket connection to server 192.168.56.101/192.168.56.101:2181. Will isn't attempt to authenticate using SASL (Unable to locate login configuration)13/07/05 19:50:05 INFO Zookeeper. Clientcnxn:socket Connection established to 192.168.56.101/192.168.56.101:2181, initiating session13/07/05 19:50:05 INFO Zookeeper. Clientcnxn:session establishment complete on server 192.168.56.101/192.168.56.101:2181, SessionID = 0x13fae9d00dd0005, Negotiated timeout = 180000 13/07/05 19:50:06 INFO client. Hconnectionmanager$hconnectionimplementation:getmaster attempt 0 of ten failed; Retrying after sleep of 1008Finally, the  reason is that the node is registered in the Zookeeper host name , so when the Eclipse remote debugging to the Windows host file to add node information such as 192.168.159.2 Master master192.168.159.3 save1 save1192.168.159.4 save2 save2192.168.159.5 save3 save3 This kind of error is basically host error, looked for a lot of zookeeper data said to the IP support is very weak, so to configure the host name and IP mapping. Otherwise it's easy to be wrong. 

After the change, you can run it again!

Java Operation HBase Error Record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.