I am getting the following error.
[2022-03-01 20:03:49.581]Container exited with a non-zero exit code 127. Error file: prelaunch.err.
Last 4096 bytes of prelaunch.err :
Last 4096 bytes of stderr :
/bin/bash: /bin/java: No such file or directory
I have set up my JAVA_HOME in the hadoop-env.sh. I am running on MacOS 12.1 so symlink is not possible.
hadoop-env.sh configuration:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.13.jdk/Contents/Home
Reinstalled Hadoop twice.
Any input is appreciated.
Hadoop version: 3.3.1 (hadoop-config.sh is fine)
CodePudding user response:
I have uninstalled the brew installation of Hadoop and installed it directly from the apache website. It is working now.
Interestingly I found all the scripts in sbin folder have JAVA_HOME predefined different path '/opt/hombrew/opt' than what my Java (I installed from the web instead of homebrew) is at. I guess homebrew version of Hadoop presets all the Java versions to where a softlink of the java installed is present.
I have again installed homebrew variant of hadoop, I can see that 3.3.2 is being pushed currently.
The start-all.sh script is as such:
#!/bin/bash JAVA_HOME="/opt/homebrew/opt/openjdk" exec "/opt/homebrew/Cellar/hadoop/3.3.2/libexec/sbin/start-all.sh" "$@"
The folder distribution of Hadoop downloaded from the Apache website and from Homebrew is a bit different.