gpt4 book ai didi

hadoop - 浏览文件系统链接 - hadoop - 本地主机链接

转载 作者:可可西里 更新时间:2023-11-01 17:01:03 25 4
gpt4 key购买 nike

我在 Ubuntu 上使用 Hadoop 2.2。

我可以在我的浏览器中加载此链接。

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

从那里,当我单击“浏览文件系统”链接时,我被发送到

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

在这里我想我想要 my_ip 而不是 localhost 和 127.0.0.1

另外,如果我手动输入

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

还是不行。

在我的整个问题文本中,my_ip 是一个外部/全局 IP。

我怎样才能让它工作?我想要的只是能够从浏览器浏览我的 HDFS 文件系统。

核心站点.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/主机

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

编辑错误:

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)

最佳答案

在你的 hdfs-site.xml 中,替换

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

通过

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

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

但通常,在伪分布式模式下,不需要指定这些属性。
更改属性后重新启动集群。

关于hadoop - 浏览文件系统链接 - hadoop - 本地主机链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24130523/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com