我已经在 ubuntu 中安装了 hadoop,并且运行良好。
ubuntu:/home/hduser/hive-0.10.0-cdh4.3.1$ jps
2702 DataNode
3101 ResourceManager
4879 Jps
2948 SecondaryNameNode
3306 NodeManager
hadoop_version=Hadoop 2.0.0-cdh4.3.0
然后我从 apache tarballs 安装了 hive(hiv version-hive-0.10.0) 并尝试运行 bin/hive。但我得到以下错误:
无法确定 Hadoop 版本信息。
hadoop version
回来:
/home/hduser/hadoop/etc/hadoop /usr/lib/jvm/jdk1.6.0_45/
Hadoop 2.0.0-cdh4.3.0
Subversion file:///var/lib/jenkins/workspace/CDH4.3.0-Packaging-Hadoop/build/cdh4/hadoop/2.0.0-cdh4.3.0/source/hadoop-common-project/hadoop-common -r 48a9315b342ca16de92fcc5be95ae3650629155a
Compiled by jenkins on Mon May 27 19:06:57 PDT 2013
From source with checksum a4218d77f9b12df4e3e49ef96f9d357d
This command was run using /home/hduser/hadoop/share/hadoop/common/hadoop-common-2.0.0-cdh4.3.0.jar
我尝试通过我的脚本知识来解决它,但不能。当我努力工作时,我发现它在以下行中失败了:
if [[ "$HADOOP_VERSION" =~ $hadoop_version_re ]]; then
我试图echo HADOOP_VERSION
让它什么也没返回,HADOOP_VERSION 被定义为
HADOOP_VERSION=$($HADOOP version | awk '{if (NR == 1) {print $2;}}');
并$HADOOP version
让我
/home/hduser/hadoop/etc/hadoop
/usr/lib/jvm/jdk1.6.0_45/
Hadoop 2.0.0-cdh4.3.0
Subversion file:///var/lib/jenkins/workspace/CDH4.3.0-Packaging-Hadoop/build/cdh4/hadoop/2.0.0-cdh4.3.0/source/hadoop-common-project/hadoop-common -r 48a9315b342ca16de92fcc5be95ae3650629155a
Compiled by jenkins on Mon May 27 19:06:57 PDT 2013
From source with checksum a4218d77f9b12df4e3e49ef96f9d357d
This command was run using /home/hduser/hadoop/share/hadoop/common/hadoop-common-2.0.0-cdh4.3.0.jar
我已经被这个打击了一个星期了。请帮帮我。谢谢。