peter.petrov
peter.petrov

Reputation: 39457

browse file system link - hadoop - localhost link

I am using Hadoop 2.2 on Ubuntu.

I am able to load this link in my browser.

http://[my_ip]:50070/dfshealth.jsp

From there, when I click the "Browse the filesystem" link, I am sent to

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

while here I think I want my_ip instead of localhost and 127.0.0.1

Also, if I type manually

http://my_ip:50075/browseDirectory.jsp?namenodeInfoPort=50070&dir=/&nnaddr=my_ip:9000

it still does not work.

The my_ip is an external/global IP throughout my whole question text.

How can I get this working? All I want is to be able to browse my HDFS filesystem from the browser.

core-site.xml

<configuration>

    <property>
    <name>fs.default.name</name>
    <value>hdfs://localhost:9000</value>
    <!-- <value>hdfs://my_ip:9000</value> -->
    </property>

<!--
   fs.default.name
   hdfs://localhost:9000
-->

</configuration>

hdfs-site.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>



<property>
<name>dfs.replication</name>
<value>1</value>
</property>


<property>
<name>dfs.namenode.name.dir</name>
<value>file:/var/lib/hadoop/hdfs/namenode</value>
</property>


<property>
<name>dfs.datanode.data.dir</name>
<value>file:/var/lib/hadoop/hdfs/datanode</value>
</property>

<!--

   dfs.replication
   1

   dfs.namenode.name.dir
   file:/var/lib/hadoop/hdfs/namenode

   dfs.datanode.data.dir
   file:/var/lib/hadoop/hdfs/datanode

-->



<property>
    <name>dfs.http.address</name>
    <value>my_ip:50070</value>
</property>

<property>
    <name>dfs.datanode.http.address</name>
    <value>my_ip:50075</value>
</property>


</configuration>

/etc/hosts

127.0.0.1       localhost test02

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

EDIT ERROR:

HTTP ERROR 500

Problem accessing /nn_browsedfscontent.jsp. Reason:

    Cannot issue delegation token. Name node is in safe mode.
The reported blocks 21 has reached the threshold 0.9990 of total blocks 21. The number of live datanodes 1 has reached the minimum number 0. Safe mode will be turned off automatically in 2 seconds.

Caused by:

org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot issue delegation token. Name node is in safe mode.
The reported blocks 21 has reached the threshold 0.9990 of total blocks 21. The number of live datanodes 1 has reached the minimum number 0. Safe mode will be turned off automatically in 2 seconds.
    at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getDelegationToken(FSNamesystem.java:5887)
    at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.getDelegationToken(NameNodeRpcServer.java:447)
    at org.apache.hadoop.hdfs.server.namenode.NamenodeJspHelper$1.run(NamenodeJspHelper.java:623)
    at org.apache.hadoop.hdfs.server.namenode.NamenodeJspHelper$1.run(NamenodeJspHelper.java:620)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)

Upvotes: 0

Views: 3873

Answers (1)

Junayy
Junayy

Reputation: 1150

In your hdfs-site.xml, replace

<property>
    <name>dfs.http.address</name>
    <value>my_ip:50070</value>
</property>

<property>
    <name>dfs.datanode.http.address</name>
    <value>my_ip:50075</value>
</property>

by

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

<property>
    <name>dfs.datanode.http.address</name>
    <value>localhost:50075</value>
</property>

But usually, in pseudo-ditributed mode it's not necessary to specify those properties.
Reboot your cluster after changing the properties.

Upvotes: 1

Related Questions