Error "Could not resolve hostname" Reported During Hadoop Startup
Symptom
The error message "ssh: Could not resolve hostname xxx" is displayed when Hadoop is started.
Key Process and Cause Analysis
None
Conclusion and Solution
Set the Hadoop environment variable to resolve this problem.
- Press Ctrl+C to stop the startup.
- Modify the ~/.bashrc file.
- Open the ~/.bashrc file.
vi ~/.bashrc
- Press i to enter the insert mode and add the following content to the ~/.bashrc file:
export HADOOP_HOME=/usr/local/hadoop export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
The setting process is the same as that of the JAVA_HOME variable. In the variable, HADOOP_HOME indicates the Hadoop installation directory.
- Press Esc, type :wq!, and press Enter to save the settings and exit.
- Open the ~/.bashrc file.
- Run the following command for the settings to take effect:
source ~/.bashrc
- Run the following command to start Hadoop:
start-dfs.sh