Support Questions
Find answers, ask questions, and share your expertise

Can't write the data into Hbase tables.

Contributor

Hi all,

I'm using kafka, spark(Scala) and Hbase.

Json data is feeded into the Kafka and it is streamed via Spark using scala code but I cant able to write it in Hbase tables.I had attached the logs for reference.

17/07/13 05:57:00 ERROR AsyncProcess: Failed to get region location org.apache.hadoop.hbase.TableNotFoundException: sample at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegionInMeta(ConnectionManager.java:1264) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.locateRegion(ConnectionManager.java:1162) at org.apache.hadoop.hbase.client.AsyncProcess.submit(AsyncProcess.java:370) at org.apache.hadoop.hbase.client.AsyncProcess.submit(AsyncProcess.java:321) at org.apache.hadoop.hbase.client.BufferedMutatorImpl.backgroundFlushCommits(BufferedMutatorImpl.java:206) at org.apache.hadoop.hbase.client.BufferedMutatorImpl.close(BufferedMutatorImpl.java:158) at org.apache.hadoop.hbase.mapreduce.TableOutputFormat$TableRecordWriter.close(TableOutputFormat.java:120) at org.apache.spark.rdd.PairRDDFunctions$anonfun$saveAsNewAPIHadoopDataset$1$anonfun$12$anonfun$apply$5.apply$mcV$sp(PairRDDFunctions.scala:1131) at org.apache.spark.util.Utils$.tryWithSafeFinallyAndFailureCallbacks(Utils.scala:1359) at org.apache.spark.rdd.PairRDDFunctions$anonfun$saveAsNewAPIHadoopDataset$1$anonfun$12.apply(PairRDDFunctions.scala:1131) at org.apache.spark.rdd.PairRDDFunctions$anonfun$saveAsNewAPIHadoopDataset$1$anonfun$12.apply(PairRDDFunctions.scala:1102) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87) at org.apache.spark.scheduler.Task.run(Task.scala:99) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:322) 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:748) 17/07/13 05:57:00 ERROR Executor: Exception in task 0.0 in stage 2.0 (TID 2) org.apache.hadoop.hbase.client.RetriesExhaustedWi

Kindly suggest.

3 REPLIES 3

Re: Can't write the data into Hbase tables.

Expert Contributor

Hi @Mathi Murugan,

The exception error says that the table where you try to write in hbase doesn't exist.

Did you already create the table? To check is the table exist: In linux shell open hbase client: hbase shell

then list all the table with the command: list

Do you see you table?

Michel

Re: Can't write the data into Hbase tables.

Contributor

Hi msumbul,

yes i checked my table exists.

Also i tried to read the table from the list, but it stated with error as mentioned below.

Also i entered my host details in /etc/hosts/ and important is my kafka system is seperate host.

Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed after attempts=36, exceptions: Thu Jul 13 23:32:28 CDT 2017, null, java.net.SocketTimeoutException: callTimeout=60000, callDuration=68643: row 'Tenants,,00000000000000' on table 'hbase:meta' at region=hbase:meta,,1.1588230740, hostname=aps-hadoop7,16020,1497499074661, seqNum=0 at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.throwEnrichedException(RpcRetryingCallerWithReadReplicas.java:271) at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:203) at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:60) 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.nextScanner(ClientScanner.java:295) at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:160) at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:155) at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:821) at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:193) at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:89) at org.apache.hadoop.hbase.client.ConnectionManager$HConnectionImplementation.isTableAvailable(ConnectionManager.java:992) at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable(HBaseAdmin.java:1486) at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable(HBaseAdmin.java:1494) at example$.main(example.scala:45) at example.main(example.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorI

Regards,

Mathi

Re: Can't write the data into Hbase tables.

Expert Contributor

So if you do in hbase, the comman scan 'tablename', you got this error?