Rate This Document
Findability
Accuracy
Completeness
Readability

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.

  1. Press Ctrl+C to stop the startup.
  2. Modify the ~/.bashrc file.
    1. Open the ~/.bashrc file.

      vi ~/.bashrc

    2. 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.

    3. Press Esc, type :wq!, and press Enter to save the settings and exit.
  3. Run the following command for the settings to take effect:

    source ~/.bashrc

  4. Run the following command to start Hadoop:

    start-dfs.sh