2014-06-09 66 views
0

我在Ubuntu上使用Hadoop 2.2。瀏覽文件系統鏈接 - hadoop - localhost鏈接

我可以在我的瀏覽器中加載此鏈接。

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

從那裏,當我點擊「瀏覽文件系統」的鏈接,我在這裏邊我想我要my_ip,而不是本地主機和127.0送到

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

.0.1

此外,如果我手動鍵入

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

它仍然不起作用。

my_ip是一個外部/全球知識產權貫穿整個問題的文本。

我該如何得到這個工作?我想要的只是能夠從瀏覽器瀏覽我的HDFS文件系統。

芯-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) 
+0

當我嘗試'telnet my_ip 50075'時,我得到這個:Connecting To my_ip ...無法打開連接到端口50075上的主機:連接失敗。 –

+0

你可以顯示你的/ etc/hosts plz嗎? – Junayy

+0

@Junayy好的,我發佈了它的內容。 –

回答

1

在您的HDFS-site.xml中,通過

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

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

更換

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

但通常,在僞ditributed模式下,它沒有必要指定這些屬性。
更改屬性後重新啓動羣集。

+0

謝謝,但這不起作用。 +1試圖幫助,非常感謝。我現在無法在瀏覽器中加載'http:// my_ip:50070 /'。有任何想法嗎? –

+0

您是否輸入http:// my_ip:50070 /或http:// localhost:50070 /? – Junayy

+0

我鍵入my_ip,這就是我想輸入的內容,即外部IP,而不是本地主機。 –