简体   繁体   中英

Setting up a single node Hadoop cluster on Mac

After setting Java path and Hadoop distribution file, when I'm trying to check the usage document I'm getting errors. I'm confused even if have set the path right. This is how I have set the path.

The following is displayed in terminal

/Users/hadoop/hadoop-2.6.0/etc/hadoop/hadoop-env.sh: line 26: JAVA_HOME=${/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home }: bad substitution

/Users/hadoop/hadoop-2.6.0/etc/hadoop/hadoop-env.sh: line 35: HADOOP_CONF_DIR=${"/Users/hadoop/hadoop-2.6.0 "}: bad substitution

By doing ${...} you are trying to do a variable substitution, thus your error.

Change to JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home instead.


Alternatively, I think this is better

export JAVA_HOME=`/usr/libexec/java_home`

And you can see it works like so

$ echo $JAVA_HOME                                               
/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

Also, following the tutorial , it doesn't literally mean put the {/path/to/folder}

export HADOOP_PREFIX={your hadoop distribution directory}

It wants you to do this for wherever you downloaded the package to

export HADOOP_PREFIX=/Users/hadoop/Downloads/hadoop-2.6.0

Then adding to the PATH would look something like

export PATH=$JAVA_HOME:$PATH
export PATH=$HADOOP_PREFIX:$PATH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM