2

I have installed apache hadoop on my virtual machine and configured it to run in pseudo distributed mode. Everything seems to work fine except one thing. I can list files and create folders using hadoop command line in my virtual machine.

When i open

http://192.168.20.200:50070 (virtual machine IP) 

from my not virtual PC, i can see some NameNode information and link "Browse the filesystem". This link has following URL:

http://192.168.20.200:50070/nn_browsedfscontent.jsp

When i click it i'm being redirected to

http://localhost:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=/

If i replace "localhost" to "192.168.20.200" everything works.

core-sites.xml

<configuration>
<property>
  <name>fs.default.name</name>
  <value>hdfs://localhost/</value>
  <description>...</description>
</property>
</configuration>

hdfs-site.xml

<property>
  <name>dfs.replication</name>
  <value>1</value>
  <description>Default block replication.</description>
</property>
<property>
  <name>dfs.name.dir</name>
  <value>/app/hadoopstorage/name/</value>
</property>

<property>
  <name>dfs.data.dir</name>
  <value>/app/hadoopstorage/data/</value>
</property>
<property>
  <name>dfs.webhdfs.enabled</name>
  <value>true</value>
</property>

Does anybody know how to fix this?

4

2 回答 2

1

当我的 /etc/hosts 文件是这样时,一切似乎都正常

127.0.0.1   localhost
127.0.1.1   name1
192.168.20.200 192.168.20.200  <--- added this line

但它看起来很奇怪。这样做是否正确?

于 2013-03-11T11:29:33.460 回答
0

127.0.0.1 (localhost)如果HOSTNAME在 HOSTS 文件中指定了错误的 IP 地址,则服务在 Hadoop 生态系统中获取并报告回环适配器地址是很常见的。

如果您要使用该/etc/hosts文件进行此路由,请确保在::1or127.0.0.1行中仅存在“localhost”或“localhost.localdomain”。

于 2016-04-28T20:08:53.397 回答