本文介绍了在Shell脚本中运行Hadoop命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的shell脚本,可以用来将日志文件移动到Hadoop集群中.

I have a simple shell script that I'd like to use to move log files into my Hadoop cluster.

当我在Java程序中调用shell脚本时,找不到该脚本"Hadoop命令",并且我不执行任何操作.

When I invoke the the shell script in my Java program, the script can not be found "Hadoop Commands", and I do not take any action.

例如,我想运行以下命令:

For instance, I would like to run the following command:

#!/bin/bash
hadoop fs -put /home/can/workspace2/myWebApp/tweets.txt /user/training/tweetFolder

我如何以简单的方式解决这个问题?

How can I solve this in a simple manner?

推荐答案

我认为这是PATH问题.检查hadoop的路径:

I believe it's a PATH problem. check the path for hadoop with which:

which hadoop

然后将完整路径放在脚本中.

Then put the full path on your script.

这篇关于在Shell脚本中运行Hadoop命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:09
查看更多