kk@kk:/usr/local/hadoop1$ ./bin/hadoop version ERROR: Cannot execute /usr/local/hadoop/libexec/hadoop-config.sh.
时间: 2023-12-20 21:31:44 浏览: 142
window上安装hadoop,直接替换bin目录,通用2.8以下所有版本
以下是两种解决方案:
1. 配置HADOOP_HOME环境变量:
```shell
vim ~/.bashrc
export HADOOP_HOME=/usr/hdp/3.1.4.0-315/hadoop
export HADOOP_CONF_DIR=/usr/hdp/3.1.4.0-315/hadoop/etc/hadoop
export HADOOP_COMMON_HOME=$HADOOP_HOME
source ~/.bashrc
./bin/hadoop version
```
2. 检查hadoop-config.sh文件是否存在,如果不存在则创建软链接:
```shell
ln -s /usr/hdp/3.1.4.0-315/hadoop/libexec/hadoop-config.sh /usr/local/hadoop/libexec/hadoop-config.sh
./bin/hadoop version
```
阅读全文