Hive and HBase integration, query exception, re-execute the Hive statistical command, there may be exceptions, because my MapReduce has been used before, and has already added pro to Hadoop
Hive and HBase integration, query exception, re-execute the Hive statistical command, there may be exceptions, because my MapReduce has been used before, and has already added pro to Hadoop
Version description
Hadoop 1.0.3
HBase 0.94.1
Hive 0.9.0
Perform operations
Hive> select count (*) from tablename;
Exception prompt
Exception in thread "Thread-54" java. lang. RuntimeException: Error while reading from task log url
At org.apache.hadoop.hive.ql.exe c. errors. TaskLogProcessor. getStackTraces (TaskLogProcessor. java: 240)
At org.apache.hadoop.hive.ql.exe c. JobDebugger. showJobFailDebugInfo (JobDebugger. java: 227)
At org.apache.hadoop.hive.ql.exe c. JobDebugger. run (JobDebugger. java: 92)
At java. lang. Thread. run (Thread. java: 662)
Caused by: java. io. IOException: Server returned HTTP response code: 400 for URL: 50060/tasklog? Taskid = attempt_201212192008_0014_m_000000_3 & start =-8193
At sun.net. (HttpURLConnection. java: 1436)
At java.net. URL. openStream (URL. java: 1010)
At org.apache.hadoop.hive.ql.exe c. errors. TaskLogProcessor. getStackTraces (TaskLogProcessor. java: 192)
... 3 more
Solution
1. path in the exception (based on your own abnormal URL)
: 50060/tasklog? Taskid = attempt_201212192008_0014_m_000000_3 & start =-8193
To:
: 50060/tasklog? Attemptid = attempt_201212192008_0014_m_000000_3 & start =-8193
Access
2. There is an exception record on the page. The exception prompt is:
Java. lang. NoClassDefFoundError: com/google/protobuf/Message
Obviously a jar is missing, and this jar can find the protobuf-java-2.4.0a.jar in HBase's jar
3. Put the jar in the lib directory of Hive, modify the configuration file conf/hive-site.xml
(If you have integrated Hadoop, HBase, and Hive, you will know that Hive has not been loaded by default)
Hive. aux. jars. path
File: // usr/java/hive-0.9.0/lib/protobuf-java-2.4.0a.jar
4. if you execute the Hive statistical command again, there may be exceptions, because my MapReduce has been used before, and the protobuf-java-2.4.0a.jar jar has been added to Hadoop, if you have not added this jar file to the lib of Hadoop before, an exception may also occur. If an exception occurs, you can still view the exception in the first step.
5. Note: If Hadoop has not previously added this jar, add all the machines in the cluster to this jar, restart Hadoop, or separately restart MapReduce. Restart the MapReduce command as follows:
Stop-mapred.sh
Start-mapred.sh