I know these kind of question were asked tons of time's, but still i couldn’t figure my specific problem
我知道這類問題被問了很多次,但我還是不能解決我的具體問題。
i have installed Hadoop, and got all the required jar's:
我已經安裝了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
and ive set the variables in the profile as required:
並且我已經根據需要設置了配置文件中的變量:
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
ive got java installed:
我有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)
and im also able to echo JAVA_HOME
而且我還能夠回傳JAVA_HOME。
yosh@yosh-VirtualBox:~$ echo $JAVA_HOME
/usr/local/java/jdk1.8.O
Ive seen some other SO questions that mention that i should edit the hadoop-config.sh
我還看到了一些其他的問題,比如我應該編輯hadoop-config.sh。
So i tried this as well (in that file):
所以我也試了一下(在那個文件中):
# 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
So im trying to run Hadoop in stand alone mode, but when im running Hadoop (ive already created input and copies there some text files), i get:
因此,我嘗試以獨立模式運行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
I just cant find an answer to this, any help will be highly appreciated!!!
我就是找不到一個答案,任何幫助都是非常感謝的!!!
BTW im using Ubuntu 14.04
我使用Ubuntu 14.04。
1 个解决方案
#1
1
Looks like a typo!
看起來像一個錯誤!
You have:
你有:
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
O is not 0 ;) Change these and it should be OK.
O不是0;)改變這些,就可以了。
Also, why define both JAVA_HOME and JRE_HOME? I have a hunch that they are the same; to confirm, try and:
另外,為什么定義JAVA_HOME和JRE_HOME?我有一種預感,它們是一樣的;確認,試着:
$ echo $(readlink -e $JAVA_HOME)
$ echo $(readlink -e $JRE_HOME)
If those are the same you can just drop JRE_HOME. And I suspect Hadoop would prioritize JAVA_HOME anyway.
如果它們是相同的,你可以把JRE_HOME刪除。而且我懷疑Hadoop會優先考慮JAVA_HOME。