执行HBase建表操作,每次创建表HRegionServer都会挂掉,而 HMaster还在!RetriesExhaustedException: Can't get the locations

来源:互联网 发布:编程cim是做什么的 编辑:程序博客网 时间:2024/06/14 05:25


在IDE  执行HBase建表操作,每次创建表HRegionServer都会挂掉,而 HMaster还在!

报错如下:


Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions:
Sun Sep 03 14:02:03 CST 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=62783: row 'ns2:stu,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=hadoop02,16020,1504416746839, seqNum=0


at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:271)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:195)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:59)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:200)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:320)
at org.apache.hadoop.hbase.client.ClientScanner.loadCache(ClientScanner.java:403)
at org.apache.hadoop.hbase.client.ClientScanner.next(ClientScanner.java:364)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:604)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:303)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:313)
at day01.Demo01HBaseAPI.createTable(Demo01HBaseAPI.java:75)
at day01.Demo01HBaseAPI.main(Demo01HBaseAPI.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.net.SocketTimeoutException: callTimeout=60000, callDuration=62783: row 'ns2:stu,,' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=hadoop02,16020,1504416746839, seqNum=0
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:159)
at org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.run(ResultBoundedCompletionService.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations
at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:312)
at org.apache.hadoop.hbase.client.ScannerCallable.prepare(ScannerCallable.java:149)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas$RetryingRPC.prepare(ScannerCallableWithReplicas.java:358)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:124)
... 4 more



Process finished with exit code 1


部分建表语句如下:

/** * 创建表 * @param admin * @throws IOException */public static void createTable(HBaseAdmin admin) throws IOException {    //先判断表是否存在    if (!admin.tableExists("ns2:stu1")){        HTableDescriptor hTable = new HTableDescriptor(TableName.valueOf("ns2:stu2"));        //创建一个表 至少需要添加一个列族        hTable.addFamily(new HColumnDescriptor("cf_info"));        hTable.addFamily(new HColumnDescriptor("cf_beizhu"));        admin.createTable(hTable);    }    admin.close();    System.out.println("----createTable end-----");}

解决办法:

自己常熟各种办法,均无果,查看节点日志也没找到有价值的信息。


最后把代码里面 if 判断表存在的语句注释掉,神奇的一幕发生了,能创建表了!好吧问题就这样解决了,还是不知道问题的根源!


最后希望大神看到后请指教!





阅读全文
1 0
原创粉丝点击