在macos中安装hadoop之后,我发现每次打开新的终端窗口时都会显示一个警告“-bash:hadoop:command not found”。怎么了?我该怎么修?谢谢。
Last login: Fri Jan 8 20:13:00 on ttys010
-bash: hadoop: command not found
SJ-DN0393:github admin$
以下是我的/etc/profile文件的内容:
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
export GITLAB_HOME=/Users/admin/dev/gitlab
export LDFLAGS="-L/usr/local/opt/python@3.7/lib"
export BASH_SILENCE_DEPRECATION_WARNING=1
export ZEPPELIN_HOME=/Users/admin/dev/zeppelin-0.9.0-preview2-bin-all
export SPARK_HOME=/Users/admin/dev/spark-3.0.1-bin-hadoop2.7
export ZOOKEEPER_HOME=/Users/admin/dev/apache-zookeeper-3.6.2-bin
export CONFLUENT_HOME=/Users/admin/dev/confluent-6.0.1
export HADOOP_HOME=/Users/admin/dev/hadoop-2.8.5
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HADOOP_CLASSPATH=`hadoop classpath`
export FLINK_HOME=/Users/admin/dev/flink-1.12.0
export FLINK_CONF_DIR=$FLINK_HOME/conf
export FLINK_OPT_DIR=$FLINK_HOME/opt
export FLINK_PLUGINS_DIR=$FLINK_HOME/plugins
export FLINK_BIN_DIR=$FLINK_HOME/bin
export FLINK_LIB_DIR=$FLINK_HOME/lib
export MYSQL_HOME=/usr/local/mysql-5.7.31-macos10.14-x86_64
export HIVE_HOME=/Users/admin/dev/apache-hive-2.3.7-bin
export HBASE_HOME=/Users/admin/dev/hbase-2.2.6
export KAFKA_HOME=/Users/admin/dev/kafka_2.12-2.4.1
export JAVA_HOME=/Users/admin/.sdkman/candidates/java/current
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$HADOOP_HOME/share/hadoop/tools/lib/hadoop-aliyun-3.3.0.jar:$HADOOP_HOME/share/hadoop/common/hadoop-common-2.8.5.jar:$HADOOP_HOME/share/hadoop/common/lib/commons-cli-1.2.jar:$HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.8.5.jar
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/opt/python@3.7/bin:/usr/local/opt/redis@4.0/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH:$FLINK_HOME/bin:$SPARK_HOME/bin:$MYSQL_HOME/bin:$ZEPPELIN_HOME/bin:$ZOOKEEPER_HOME/bin:$HBASE_HOME/bin:$KAFKA_HOME/bin:$CONFLUENT_HOME/bin:$HIVE_HOME/bin
1条答案
按热度按时间8fq7wneg1#
你有
hadoop classpath
在打开shell时被调用。自
hadoop
在获取此文件的最后一步之前不在路径中,将找不到该命令可以使用适当的解决方案
$HADOOP_HOME/bin/hadoop classpath