我用教程安装hive: https://www.edureka.co/blog/apache-hive-installation-on-ubuntu 还有其他一些。
我创建数据库,表,加载数据是成功的,但另一个是map / reduce任务错误
hive> create database mydb;
enter code here
OK
Time taken: 0.366 seconds
hive> CREATE TABLE IF NOT EXISTS employee ( eid int, name String,
> salary String, destination String)
> COMMENT 'Employee details'
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY '\t'
> LINES TERMINATED BY '\n'
> STORED AS TEXTFILE;
OK
Time taken: 0.695 seconds
hive> LOAD DATA LOCAL INPATH '/home/hduser/sample.txt'
> OVERWRITE INTO TABLE employee;
Loading data to table default.employee
OK
Time taken: 1.662 seconds
hive> select count(*) from employee;
WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Query ID = hduser_20170929160939_b7499547-27d4-4989-b7de-20d41d9b4987
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
set mapreduce.job.reduces=<number>
Starting Job = job_1506674663137_0001, Tracking URL = http://khanhpc-ThinkPad-X220:8088/proxy/application_1506674663137_0001/
Kill Command = /usr/local/hadoop/bin/hadoop job -kill job_1506674663137_0001
Hadoop job information for Stage-1: number of mappers: 0; number of reducers: 0
2017-09-29 16:09:49,375 Stage-1 map = 0%, reduce = 0%
Ended Job = job_1506674663137_0001 with errors
Error during job, obtaining debugging information...
Job Tracking URL: http://khanhpc-ThinkPad-X220:8088/cluster/app/application_1506674663137_0001
FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched:
Stage-Stage-1: HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec
答案 0 :(得分:0)
感谢大家。这个错误让我失去了1周。错误版本
1)Hadoop 3.x.x不支持hive 1.x.x
2)hive命令不支持hive 2.x.x.它使用beeline命令
我在 hive 2.3.0 中运行beeline命令并安装 hadoop 2.8.0 。一切都好吗