本文介绍了hadoop的classpath设置在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hadoop的classpath在哪里设置?
当我运行下面的命令时,它给了我类路径。 classpath设置在哪里?
以下是 hadoop-env.sh 中的相关代码,它添加了容量调度程序和aws jar's 。
export HADOOP_CONF_DIR = $ {HADOOP_CONF_DIR: - / etc / hadoop}
#Extra Java CLASSPATH元素。自动插入容量调度程序。
for $ HADOOP_HOME / contrib / capacity-scheduler / *。jar;如果[$ HADOOP_CLASSPATH]执行
;然后
export HADOOP_CLASSPATH = $ HADOOP_CLASSPATH:$ f
else
export HADOOP_CLASSPATH = $ f
fi
完成
#...一些其他行省略
#添加Aws jar
export HADOOP_CLASSPATH = $ HADOOP_CLASSPATH:share / hadoop / tools / lib / *
Where is the classpath for hadoop set?When I run the below command it gives me the classpath. Where is the classpath set?
bin/hadoop classpathI'm using hadoop 2.6.0
解决方案As said by almas shaikh it's set in hadoop-config.sh, but you could add more jars to it in hadoop-env.sh
Here is a relevant code from hadoop-env.sh which adds additional jars like capacity-scheduler and aws jar's.
export HADOOP_CONF_DIR=${HADOOP_CONF_DIR:-"/etc/hadoop"} # Extra Java CLASSPATH elements. Automatically insert capacity-scheduler. for f in $HADOOP_HOME/contrib/capacity-scheduler/*.jar; do if [ "$HADOOP_CLASSPATH" ]; then export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$f else export HADOOP_CLASSPATH=$f fi done # ... some other lines omitted # Add Aws jar export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:share/hadoop/tools/lib/*
这篇关于hadoop的classpath设置在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!