You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Hadoop新手求助:Ubuntu系统下localhost:9870无法访问

Troubleshooting "Page Not Found" for localhost:9870 on Ubuntu (Hadoop Beginner Guide)

Hey there, fellow Hadoop beginner! Let's work through that "page doesn't exist" error when trying to access localhost:9870—this is a super common hiccup when getting started, so don't worry, we'll fix it together.

Here are the most likely fixes, ordered from easiest to check:

1. Verify Hadoop Services Are Running

The localhost:9870 URL is for the NameNode Web UI, which only works if the Hadoop HDFS services are up and running.

  • Open your terminal and run this command to check active Hadoop processes:
    jps
    
    You should see at least NameNode, DataNode, and ResourceManager in the output. If these are missing, start the services:
    start-dfs.sh  # Starts HDFS services (NameNode/DataNode)
    start-yarn.sh # Starts YARN services (ResourceManager/NodeManager)
    
    Note: Some older Hadoop setups use start-all.sh, but it's deprecated in newer versions—stick to the two separate commands above.

2. Double-Check Hadoop Configuration Files

Incorrect configs are the #1 culprit here. You'll need to verify two key files in your Hadoop installation directory (usually $HADOOP_HOME/etc/hadoop/):

core-site.xml

Open it with a text editor (e.g., nano $HADOOP_HOME/etc/hadoop/core-site.xml) and make sure it has this property:

<property>
  <name>fs.defaultFS</name>
  <value>hdfs://localhost:9000</value>
</property>

hdfs-site.xml

Check this file for the NameNode HTTP address property:

<property>
  <name>dfs.namenode.http-address</name>
  <value>localhost:9870</value>
</property>

After making any changes, restart all Hadoop services to apply them.

3. Check Ubuntu Firewall Settings

Ubuntu's default firewall (ufw) might be blocking port 9870.

  • First, test if disabling the firewall fixes the issue:
    sudo ufw disable
    
    If you can access localhost:9870 now, re-enable the firewall and add a rule to allow the port:
    sudo ufw allow 9870/tcp
    sudo ufw enable
    

4. Ensure Port 9870 Isn't Occupied by Another Process

Sometimes another app might be using port 9870. Check with this command:

ss -tulpn | grep 9870

If you see a process listed here, you can either:

  • Kill that process (use sudo kill <PID> where <PID> is the process ID), or
  • Update the dfs.namenode.http-address property in hdfs-site.xml to use a different port (e.g., 9871), then restart Hadoop.

5. Rule Out Browser Issues

  • Double-check you typed the URL correctly: it's http://localhost:9870 (not 9070 or another typo).
  • Try accessing it in a private/incognito window to bypass cached pages.

If none of these steps work, feel free to share the output of jps and your config files—we can dig deeper!

内容的提问来源于stack exchange,提问作者Kevin Su

火山引擎 最新活动