hadoop single node setup
NickName:shshnk Ask DateTime:2011-05-10T22:52:02

hadoop single node setup

I am trying to do a single node setup for hadoop as given on following link http://hadoop.apache.org/common/docs/current/single_node_setup.html i have followed all the steps till defining JAVA_HOME but the command "$ bin/hadoop" is not working for me.there is no file or folder related to hadoop in my bin folder.what does this command do and why its not working for me??

Copyright Notice:Content Author:「shshnk」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/5951983/hadoop-single-node-setup

Answers
Paul W 2011-05-10T15:18:35

that means execute the command './bin/hadoop' from the hadoop home directory. That is, the hadoop command is in the bin sub-directory underneath the hadoop install directory.",


Debugger 2011-12-23T06:24:47

The check_basic_env.sh Script\n\n#! /bin/sh\n# This block is trying to do the basics of checking to see if\n# the HADOOP_HOME and the JAVA_HOME variables have been set correctly\n# and if they are not been set, suggest a setting in line with the earlier examples\n# The script actually tests for:\n# the presence of the java binary and the hadoop script,\n# and verifies that the expected versions are present\n# that the version of java and hadoop is as expected (warning if not)\n# that the version of java and hadoop referred to by the\n# JAVA_HOME and HADOOP_HOME environment variables are default version to run.\n#\n#\n# The 'if [' construct you see is a shortcut for 'if test' ....\n# the -z tests for a zero length string\n# the -d tests for a directory\n# the -x tests for the execute bit\n# -eq tests numbers\n# = tests strings\n# man test will describe all of the options\n# The '1>&2' construct directs the standard output of the\n# command to the standard error stream.\nif [ -z \"$HADOOP_HOME\" ]; then\n echo \"The HADOOP_HOME environment variable is not set\" 1>&2\n if [ -d ~/src/hadoop-0.19.0 ]; then\n echo \"Try export HADOOP_HOME=~/src/hadoop-0.19.0\" 1>&2\n fi\n exit 1;\nfi\n# This block is trying to do the basics of checking to see if\n# the JAVA_HOME variable has been set\n# and if it hasn't been set, suggest a setting in line with the earlier examples\nif [ -z \"$JAVA_HOME\" ]; then\n echo \"The JAVA HOME environment variable is not set\" 1>&2\n if [ -d /usr/java/jdk1.6.0_07 ]; then\n echo \"Try export JAVA_HOME=/usr/java/jdk1.6.0_07\" 1>&2\n fi\n exit 1\nfi\n\n\n# We are now going to see if a java program and hadoop programs\n# are in the path, and if they are the ones we are expecting.\n# The which command returns the full path to the first instance\n# of the program in the PATH environment variable\n#\nJAVA_BIN=`which java`\nHADOOP_BIN=`which hadoop`\n# Check for the presence of java in the path and suggest an\n# appropriate path setting if java is not found\nif [ -z \"${JAVA_BIN}\" ]; then\n echo \"The java binary was not found using your PATH settings\" 1>&2\n if [ -x ${JAVA_HOME}/bin/java ]; then\n echo 'Try export PATH=${JAVA_HOME}/bin' 1>&2\n fi\n exit 1\nfi\n# Check for the presence of hadoop in the path and suggest an\n# appropriate path setting if java is not found\nif [ -z \"${HADOOP_BIN}\" ]; then\n echo \"The hadoop binary was not found using your PATH settings\" 1>&2\n if [ -x ${HADOOP_HOME}/bin/hadoop ]; then\n echo 'Try export PATH=${HADOOP_HOME}/bin:${PATH}' 1>&2\n fi\n exit 1\nfi\n# Double check that the version of java installed in ${JAVA_HOME}\n# is the one stated in the examples.\n# If you have installed a different version your results may vary.\n#\nif ! ${JAVA_HOME}/bin/java -version 2>&1 | grep -q 1.6.0_07; then\n (echo –n \"Your JAVA_HOME version of java is not the\"\n echo –n \" 1.6.0_07 version, your results may vary from\"\n echo \" the book examples.\") 1>&2\nfi\n# Double check that the java in the PATH is the expected version.\nif ! java -version 2>&1 | grep -q 1.6.0_07; then\n (echo –n \"Your default java version is not the 1.6.0_07 \"\n echo –n \"version, your results may vary from the book\"\n echo \" examples.\") 1>&2\nfi\n\n # Try to get the location of the hadoop core jar file\n # This is used to verify the version of hadoop installed\n HADOOP_JAR=`ls -1 ${HADOOP_HOME}/hadoop-0.19.0-core.jar`\n HADOOP_ALT_JAR=`ls -1 ${HADOOP_HOME}/hadoop-*-core.jar`\n # If a hadoop jar was not found, either the installation\n # was incorrect or a different version installed\n if [ -z \"${HADOOP_JAR}\" -a -z \"${HADOOP_ALT_JAR}\" ]; then\n (echo –n \"Your HADOOP_HOME does not provide a hadoop\"\n echo –n \" core jar. Your installation probably needs\"\n echo –n \" to be redone or the HADOOP_HOME environment\"\n echo variable needs to be correctly set.\") 1>&2\n exit 1\n fi\n if [ -z \"${HADOOP_JAR}\" -a ! -z \"${HADOOP_ALT_JAR}\" ]; then\n (echo –n \"Your hadoop version appears to be different\"\n echo –n \" than the 0.19.0 version, your results may vary\"\n echo \" from the book examples.\") 1>&2\n fi\n if [ `pwd` != ${HADOOP_HOME} ]; then\n (echo –n 'Please change your working directory to\"\n echo –n \" ${HADOOP_HOME}. cd ${HADOOP_HOME} <Enter>\") 1>&2\n exit 1\n fi\n echo \"You are good to go\"\n echo –n \"your JAVA_HOME is set to ${JAVA_HOME} which \"\n echo \"appears to exist and be the right version for the examples.\"\n echo –n \"your HADOOP_HOME is set to ${HADOOP_HOME} which \"\n echo \"appears to exist and be the right version for the examples.\"\n echo \"your java program is the one in ${JAVA_HOME}\"\n echo \"your hadoop program is the one in ${HADOOP_HOME}\"\n echo –n \"The shell current working directory is ${HADOOP_HOME} \"\n echo \"as the examples require.\"\n if [ \"${JAVA_BIN}\" = \"${JAVA_HOME}/bin/java\" ]; then\n echo \"Your PATH appears to have the JAVA_HOME java program as the default java.\"\n else\n echo –n \"Your PATH does not appear to provide the JAVA_HOME\"\n echo \" java program as the default java.\"\n fi\n\n\nif [ \"${HADOOP_BIN}\" = \"${HADOOP_HOME}/bin/hadoop\" ]; then\n echo –n \"Your PATH appears to have the HADOOP_HOME\"\n echo \" hadoop program as the default hadoop.\"\nelse\n echo –n \"Your PATH does not appear to provide the the HADOOP_HOME \"\n echo \"hadoop program as the default hadoop program.\"\nfi\nexit 0\n\n\nThis script will help you to check all your env variables and configs.\nTry this bash script, by storing it hadoop root directory.\nRun it by simply writing ./check_basic_env.sh .",


More about “hadoop single node setup” related questions