在linux安装hadoop集群下执行hive任务

一、安装hadoop

linux下安装hadoop

二、安装hive

linux下安装hive

三、上面是安装hadoop集群和hive的方法

四、执行任务

4.1、创建数据库

4.2、创建表

4.3、导入数据

4.4、执行统计任务

select count(*) from student;

4.5、执行完成后

hive> select count(*) from student;
Query ID = root_20231112015526_db2d3c2d-0892-4ed0-a1cc-fae1e66fd0b0
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_1699725018325_0002, Tracking URL = http://node1:8088/proxy/application_1699725018325_0002/
Kill Command = /usr/local/bigdata/hadoop-3.3.6/bin/mapred job  -kill job_1699725018325_0002
Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 1
2023-11-12 01:55:43,358 Stage-1 map = 0%,  reduce = 0%
2023-11-12 01:55:50,508 Stage-1 map = 100%,  reduce = 0%, Cumulative CPU 1.86 sec
2023-11-12 01:55:58,663 Stage-1 map = 100%,  reduce = 100%, Cumulative CPU 4.4 sec
MapReduce Total cumulative CPU time: 4 seconds 400 msec
Ended Job = job_1699725018325_0002
MapReduce Jobs Launched: 
Stage-Stage-1: Map: 1  Reduce: 1   Cumulative CPU: 4.4 sec   HDFS Read: 30204 HDFS Write: 104 SUCCESS
Total MapReduce CPU Time Spent: 4 seconds 400 msec
OK
1263
Time taken: 32.947 seconds, Fetched: 1 row(s)

4.6、hadoop查看任务

这样就可以看到在hadoop上执行的任务了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值