当一个类型为start-dfs.sh然后访问网站my_ip(上面只有10.0.0.151)时,我设置了一个带有两个节点hadoop01(master-10.0.0.151)和hadoop02(slave-10.0.0.152)的hadoop集群:50070.它很成功.
但是当我输入start-yarn.sh然后访问网站my_ip:8088.它失败了.
我的yarn-site.xml:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>hadoop01:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>hadoop01:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>hadoop01:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>hadoop01:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>hadoop01:8088</value>
</property>
Run Code Online (Sandbox Code Playgroud)
核心-site.xml中:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop01:8020</value>
</property>
</configuration>
Run Code Online (Sandbox Code Playgroud)
与hadoop02相同的设置(奴隶)
我的hadoop01 hadoop-2.2.0/etc/hadoop/slaves设置
hadoop01
hadoop02
Run Code Online (Sandbox Code Playgroud)
键入start-dfs.sh&start-yarn.sh后输入jps
hadoop01:
21594 NameNode
22345 NodeManager
22007 SecondaryNameNode
22171 ResourceManager
23147 Jps
21762 DataNode
hadoop02:
29861 NodeManager
30358 Jps
29665 DataNode
Run Code Online (Sandbox Code Playgroud)
我的/ etc/hosts在hadoop01中:
localhost hadoop01
10.0.0.151 hadoop01
10.0.0.152 hadoop02
Run Code Online (Sandbox Code Playgroud)
我的/ etc/hosts在hadoop02中:
localhost hadoop02
10.0.0.151 hadoop01
10.0.0.152 hadoop02
Run Code Online (Sandbox Code Playgroud)
这个轰鸣声链接是我的yarn-nodemanager.log我上传到谷歌dirve https://drive.google.com/file/d/0B7nCJ_XJWSrQN1BZVTVyOEgxd1E/edit?usp=sharing 但是如果我没有出现错误,那么yarn-nodemanager.log就不会出现错误不要错过一些信息..
请帮我改进为什么我不能访问该网站的问题 http://10.0.0.151:8088
**如果需要其他信息(如hdfs-site.xml等),请告诉我.我会更新..
netstat -tunalp | grep LISTEN
tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN 17442/java
tcp 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN 17442/java
tcp 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN 17442/java
tcp 0 0 0.0.0.0:50090 0.0.0.0:* LISTEN 17693/java
tcp 0 0 10.0.0.151:8020 0.0.0.0:* LISTEN 17267/java
tcp 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN 17267/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp6 0 0 :::13562 :::* LISTEN 21061/java
tcp6 0 0 10.0.0.151:8030 :::* LISTEN 20881/java
tcp6 0 0 10.0.0.151:8031 :::* LISTEN 20881/java
tcp6 0 0 10.0.0.151:8032 :::* LISTEN 20881/java
tcp6 0 0 10.0.0.151:8033 :::* LISTEN 20881/java
tcp6 0 0 :::33762 :::* LISTEN 21061/java
tcp6 0 0 :::8040 :::* LISTEN 21061/java
tcp6 0 0 :::8042 :::* LISTEN 21061/java
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 10.0.0.151:8088 :::* LISTEN 20881/java
Run Code Online (Sandbox Code Playgroud)
禁用ipv6后,我输入netstat -tunalp | grep LISTEN
tcp 0 0 0.0.0.0:13562 0.0.0.0:* LISTEN 30608/java
tcp 0 0 0.0.0.0:50010 0.0.0.0:* LISTEN 29967/java
tcp 0 0 0.0.0.0:50075 0.0.0.0:* LISTEN 29967/java
tcp 0 0 10.0.0.151:8030 0.0.0.0:* LISTEN 30424/java
tcp 0 0 10.0.0.151:8031 0.0.0.0:* LISTEN 30424/java
tcp 0 0 0.0.0.0:52992 0.0.0.0:* LISTEN 30608/java
tcp 0 0 10.0.0.151:8032 0.0.0.0:* LISTEN 30424/java
tcp 0 0 10.0.0.151:8033 0.0.0.0:* LISTEN 30424/java
tcp 0 0 0.0.0.0:50020 0.0.0.0:* LISTEN 29967/java
tcp 0 0 0.0.0.0:8040 0.0.0.0:* LISTEN 30608/java
tcp 0 0 0.0.0.0:8042 0.0.0.0:* LISTEN 30608/java
tcp 0 0 0.0.0.0:50090 0.0.0.0:* LISTEN 30222/java
tcp 0 0 10.0.0.151:8020 0.0.0.0:* LISTEN 29790/java
tcp 0 0 0.0.0.0:50070 0.0.0.0:* LISTEN 29790/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 10.0.0.151:8088 0.0.0.0:* LISTEN 30424/java
tcp6 0 0 :::22 :::* LISTEN -
Run Code Online (Sandbox Code Playgroud)
小智 9
原因是您应该将 10.0.0.151:8088 更改为 0.0.0.0:8088。方法是打开yarn-site.xml,添加:
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>0.0.0.0:8088</value>
</property>
Run Code Online (Sandbox Code Playgroud)
这里的问题是资源管理器正在运行,但是资源管理器占用的端口(8030,8031,8032,8033,8088)使用tcp6而不是tcp(请参见左侧)。您有两个选择,要么可以在linux系统中禁用ipv6,然后重新启动yarn服务。
要么
尝试仅在主节点上修改您的yarn-site.xml,如下所示。不要在从属节点中修改yarn-site.xml:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<configuration>
Run Code Online (Sandbox Code Playgroud)
指定主机名会使端口以tcp6开头,即使不指定这些端口也将采用默认值。看看以下默认端口
http://hadoop.apache.org/docs/r2.2.0/hadoop-yarn/hadoop-yarn-common/yarn-default.xml
修改yarn-site.xml后,重新启动yarn服务