Hadoop HADOOP_CLASSPATH issues

后端 未结 3 1827
南旧
南旧 2020-12-30 12:31

This question doesn\'t refer to distributing jars in the whole cluster for the workers to use them.

It refers to specifying a number of additional libraries on the

3条回答
  •  情深已故
    2020-12-30 13:16

    If you are allowed to set HADOOP_CLASSPATH then

    export HADOOP_CLASSPATH=/path/to/jar/myjar.jar:$HADOOP_CLASSPATH; \
        hadoop fs -text /path/in/HDFS/to/my/file
    

    will do the job. Since in your case this variable is overridden in hadoop-env.sh therefore, consider using the -libjars option instead:

    hadoop fs -libjars /path/to/jar/myjar.jar -text /path/in/HDFS/to/my/file
    

    Alternatively invoke FsShell manually:

    java -cp $HADOOP_HOME/lib/*:/path/to/jar/myjar.jar:$CLASSPATH \
    org.apache.hadoop.fs.FsShell -conf $HADOOP_HOME/conf/core-site.xml \
    -text /path/in/HDFS/to/my/file
    

提交回复
热议问题