【发布时间】:2019-05-14 12:35:43
【问题描述】:
我在 mac 上运行 hadoop 3.1.2,执行 ./start-all.sh 时出现错误提示
Starting namenodes on [localhost]
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-functions.sh: line 398: syntax error near unexpected token `<'
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-functions.sh: line 398: ` done < <(for text in "${input[@]}"; do'
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-config.sh: line 70: hadoop_deprecate_envvar: command not found
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-config.sh: line 87: hadoop_bootstrap: command not found
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-config.sh: line 104: hadoop_parse_args: command not found
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-config.sh: line 105: shift: : numeric argument required
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-config.sh: line 244: hadoop_need_reexec: command not found
/usr/local/Cellar/hadoop/3.1.2/libexec/bin/../libexec/hadoop-config.sh: line 252: hadoop_verify_user_perm: command not found
我打开 hadoop-functions.sh 并在第 398 行找到以下信息:
done < <(for text in "${input[@]}"; do
echo "${text}"
done | sort)
知道如何解决这个问题吗?
【问题讨论】:
-
这看起来像一个错误。您是如何安装 Hadoop 的?
-
brew install hadoop @tk421
-
我认为是bug,我可以分别启动name node和data node,但是不能使用start-all.sh或者start yarn @tk421
-
是的,我深入研究了代码库,并且已经存在了一段时间。这是 bash 的不兼容,MacOS 的 bash 版本是 3.x,而大多数 Linux 运行的是 bash 4.x。
-
看来古版 bash 是由于apple.stackexchange.com/questions/193411/….