Schedulis执行任务
添加执行用户或组是否有相应的权限。
sudo adduser hadoop
sudo usermod -a -G hadoop hadoop
#并为该用户赋予 root 权限
vim /etc/sudoers
hadoop ALL=(ALL) NOPASSWD: NOPASSWD: ALL
一、执行command任务
新建hello项目、hello.job打包zip,上传hello项目执行任务。
#hello job
type=command
command=echo "This is hello1 job."
二、执行hive任务
-
准备hive环境 #增加hive客户端软连接
ln -s /opt/hive/apache-hive-1.2.1-bin/bin/hive /appcom/Install/hive
-
Hive脚本:hive.sql use default;
drop table hive;
create table hive(id int, name string) row format delimited fields terminated by ",";
load data local inpath '/appcom/test/hive.txt' into table student;
insert overwrite local directory '/appcom/test/hive'
row format delimited fields terminated by '\t'
select * from hive;
-
新建hive项目、hive.job打包zip,上传hive项目执行任务。 #hive job
type=command
command=hive -f /appcom/test/hive.sql
|