skip to Main Content

When I execute start-dfs.sh first time, there is a error about datanode. The log likes:

Starting namenodes on [hadoop01]
Starting datanodes
: hostname contains invalid characters
: hostname contains invalid characters
: hostname contains invalid characters
Starting secondary namenodes [hadoop03]

Hadoop version is V3.1.3

OS: 112~20.04.1-Ubuntu

2

Answers


  1. The error message "hostname contains invalid characters" typically occurs in Hadoop when the hostname of a datanode contains characters that are not valid according to the naming conventions.

    Here are some steps to resolve this issue:

    Check hostname: Verify the hostname of the datanode to ensure it complies with the naming conventions. Hostnames should consist only of alphanumeric characters and hyphens ("-"). They should not start or end with a hyphen.

    Update hostname: If the hostname contains invalid characters, update it to comply with the naming conventions. You can change the hostname of the machine where the datanode is running.

    Edit /etc/hosts: Ensure that the hostname is correctly configured in the /etc/hosts file. The hostname should be mapped to the correct IP address.

    Restart services: After updating the hostname, restart the Hadoop services, including the datanode, to apply the changes.

    Verify configuration: Double-check the Hadoop configuration files (core-site.xml, hdfs-site.xml, etc.) to ensure that the hostname is correctly specified and matches the updated hostname.

    Check network settings: Ensure that the network settings of the machine are configured properly, including DNS resolution and hostname resolution.

    Diagnostic logs: Check the Hadoop logs (e.g., hadoop-hdfs-datanode.log) for more detailed error messages that may provide additional insights into the issue.

    By following these steps and ensuring that the hostname complies with the naming conventions, you should be able to resolve the "hostname contains invalid characters" error in your Hadoop datanode.

    Login or Signup to reply.
  2. Yes, I have the same problem.

    but i can start the datanode by this:

    sbin/hadoop-daemon.sh start datanode

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search