Hadoop:连接到ResourceManager失败



在安装hadoop 2.2并尝试启动管道示例后,我得到了以下错误(在尝试启动hadoop jar hadoop-mapreduce-examples-2.2.0.jar wordcount someFile.txt /out后出现相同错误):

/usr/local/hadoop$ hadoop pipes -Dhadoop.pipes.java.recordreader=true -Dhadoop.pipes.java.recordwriter=true -input someFile.txt -output /out -program bin/wordcount
DEPRECATED: Use of this script to execute mapred command is deprecated.
Instead use the mapred command for it.
13/12/14 20:12:06 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
13/12/14 20:12:06 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
13/12/14 20:12:07 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:08 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:09 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:10 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 3 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:11 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 4 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:12 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 5 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:13 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 6 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/14 20:12:14 INFO ipc.Client: Retrying connect to server: 0.0.0.0/0.0.0.0:8032. Already tried 7 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)

我的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>
<!-- Site specific YARN configuration properties -->
</configuration>

core-site.xml:

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

mapred-site.xml:

<configuration>
<property>
  <name>mapreduce.framework.name</name>
  <value>yarn</value>
</property>
</configuration>

hdfs-site.xml:

<configuration>
<property>
  <name>dfs.replication</name>
  <value>1</value>
</property>
<property>
  <name>dfs.namenode.name.dir</name>
  <value>file:/home/hduser/mydata/hdfs/namenode</value>
</property>
<property>
  <name>dfs.datanode.data.dir</name>
  <value>file:/home/hduser/mydata/hdfs/datanode</value>
</property>
</configuration>

我发现我的IPv6被禁用了。也许我的/etc/hosts不正确?

/etc/主机:

fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.0.1 localhost.localdomain localhost hduser
# Auto-generated hostname. Please do not remove this comment.
79.98.30.76 356114.s.dedikuoti.lt  356114
::1             localhost ip6-localhost ip6-loopback

连接资源管理器的问题是因为我需要向yarn-site.xml添加一些属性:

<property>
<name>yarn.resourcemanager.address</name>
<value>127.0.0.1:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>127.0.0.1:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>127.0.0.1:8031</value>
</property>

然而,我的工作没有运行,但现在连接成功了

确保您已启动Yarn。使用此命令启动:

启动-学习.sh

然后使用此命令验证资源管理器是否正在运行:

jps

输出应该是这样的:

17542名称节点

17920 SecondaryName节点

22064 Jps

17703数据节点

18226 ResourceManager

18363 NodeManager

正确的方法可能是在yarn site.xml中添加以下行:

<property>
    <name>yarn.resourcemanager.hostname</name>
    <value>127.0.0.1</value>
</property>

因为值字段host表示可以设置的单个主机名,而不是设置所有yar.resourcemanager*地址资源。导致ResourceManager组件的默认端口。

Apache Hadoop 2.7.1-ResourceManager 的配置

  • 参数:yarn.resourcemanager.hostname
  • 值:ResourceManager主机
  • 注意:host可以设置单个主机名来代替设置所有yars.resourcemanager*地址资源。导致ResourceManager组件的默认端口

我也遇到过同样的问题。我解决了。

由于连接到ResourceManager时出现问题,因此,请确保Yarn是否正在运行。纱线被分成不同的实体。其中一个是ResourceManager,它负责为集群中运行的各种应用程序分配资源。

请执行以下步骤。

  1. 使用命令启动Yarn:Start-Yarn.sh
  2. 使用命令jps检查资源管理器nod
  3. 将以下代码添加到配置中
<property>
    <name>yarn.resourcemanager.address</name>
    <value>127.0.0.1:8032</value>
</property>

我通过在yarn-site.xml 中将值更改为127.0.0.1:*解决了同样的问题

<property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
    </property>
    <property>
    <name>yarn.resourcemanager.address</name>
    <value>127.0.0.1:8032</value>
     </property>
      <property>
    <name>yarn.resourcemanager.scheduler.address</name>
    <value>127.0.0.1:8030</value>
     </property>
    <property>
    <name>yarn.resourcemanager.resource-tracker.address</name>
    <value>127.0.0.1:8031</value>
     </property>
Configuration conf = HBaseConfiguration.create();
 conf.set("yarn.resourcemanager.address", "127.0.0.1:8032");

在conf中,您可以设置yarn.resourcemanager.address

此问题可能是由于缺少HADOOP_CONF_DIR,MapReduce应用程序连接到yarn-site.xml中提到的资源管理器所需的HADOOP_ONF_DIR。因此,在运行MapReduce作业之前,请尝试使用适当的HADOOP CONF目录手动设置/导出HADOOP_CONF_DIR,如export HADOOP_CONF_DIR=/etc/HADOOP/CONF。这种方式对我有效:)

在我的情况下,我的xml配置文件中有一个拼写错误。您可以在$HADOOP_HOME/logs/yarn rdmaHB resourcemanager-(yourhostname).log上查看日志,可能有一个有用的stacktrack。

发生此错误是因为资源管理器无法启动。如果你已经做了其他人所说的更改配置文件,但仍然得到错误,那么请参阅

注:-Windows 10,Hadoop 3.1.3验证

因此,如果您是Windows用户,请转到hadoop-3.1.3/sbin/。执行stop-all.cmd然后启动all.cmd

现在已经打开了许多终端,它们是nodemanager、datanode、namenode&资源管理器。有关资源管理器终端中的错误消息,请参阅。这个错误应该是你的问题。

如果错误消息如下:-
java.lang.NoClassDefFoundError:org/apache/hadop/yarn/server/timelineservice/collector/TimelineCollectorManager

复制以下文件
来自~/hadoop-13.3/share/hadop/yarn/timelineservice
文件:hadoop-yarn-server-timelineservice-3.1.3.jar
至~/hadoop-13.3/share/hadoop/syarn

这应该能解决你的问题。

/etc/hosts中使用以下设置,添加您的主机名以代替your_host_name:

127.0.0.1   localhost
127.0.0.1   your_host_name

相关内容

  • 没有找到相关文章

最新更新