我知道这类问题被问了很多次,但我还是不知道我的具体问题
我已安装 Hadoop
,并获得了所有必需的jar:
yosh@yosh-VirtualBox:~/hadoop$ ls
hadoop-1.2.1 hadoop-1.2.1.tar.gz
yosh@yosh-VirtualBox:~/hadoop/hadoop-1.2.1$ ls
bin hadoop-ant-1.2.1.jar input README.txt
build.xml hadoop-client-1.2.1.jar ivy sbin
c++ hadoop-core-1.2.1.jar ivy.xml share
CHANGES.txt hadoop-examples-1.2.1.jar lib src
conf hadoop-minicluster-1.2.1.jar libexec webapps
contrib hadoop-test-1.2.1.jar LICENSE.txt
docs hadoop-tools-1.2.1.jar NOTICE.txt
我会根据需要设置配置文件中的变量:
export JAVA_HOME=/usr/local/java/jdk1.8.o
PATH=$PATH:$JAVA_HOME/bin
JRE_HOME=/usr/local/java/jre1.8.o
PATH=$PATH:$JRE_HOME/bin
HADOOP_INSTALL=/home/hadoop/Hadoop/hadoop-1.2.1
PATH=$PATH:$HADOOP_INSTALL/bin
export JAVA_HOME
export JRE_HOME
export PATH
我安装了java:
yosh@yosh-VirtualBox:~$ java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
我也能回 java 的家
yosh@yosh-VirtualBox:~$ echo $JAVA_HOME
/usr/local/java/jdk1.8.O
我看到一些其他的问题提到我应该编辑hadoop-config.sh
所以我也尝试了这个(在那个文件中):
# we use in Hadoop. Tune the variable down to prevent vmem explosion.
export MALLOC_ARENA_MAX=${MALLOC_ARENA_MAX:-4}
export HADOOP_HOME=${HADOOP_PREFIX}
export HADOOP_HOME
_WARN_SUPPRESS=1
export $JAVA_HOME # ive added here the java home
所以我尝试在独立模式下运行hadoop,但是当我运行hadoop时(我已经创建了输入并复制了一些文本文件),我得到:
yosh@yosh-VirtualBox:~/hadoop/hadoop-1.2.1$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
bin/hadoop: line 350: /usr/local/java/jdk1.8.O/bin/java: No such file or directory
我只是找不到答案,任何帮助都将不胜感激!!!
顺便说一句,我使用的是ubuntu 14.04
1条答案
按热度按时间xmjla07d1#
看起来像是打字错误!
您有:
$ echo $(readlink -e $JAVA_HOME)
$ echo $(readlink -e $JRE_HOME)