簡體   English   中英

如何更改連接到的“ hadoop jar”命令的地址?

[英]How to change address 'hadoop jar' command is connecting to?

我一直在嘗試使用以下命令在集群上啟動MapReduce作業:

bin/hadoop jar myjar.jar MainClass /user/hduser/input /user/hduser/output

但是我一遍又一遍地得到以下錯誤,直到連接被拒絕:

13/08/08 00:37:16 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:54310. Already tried 5 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)

然后,我與netstat進行了檢查,以查看服務是否在偵聽正確的端口:

~> sudo netstat -plten | grep java
tcp        0      0 10.1.1.4:54310          0.0.0.0:*               LISTEN      10022      38365       11366/java
tcp        0      0 10.1.1.4:54311          0.0.0.0:*               LISTEN      10022      32164       11829/java

現在我注意到我的服務正在偵聽端口10.1.1.4:54310,這是我的主服務器的IP,但是似乎“ hadoop jar”命令正在連接到127.0.0.1(同一台機器上的localhost)但因此找不到該服務。 無論如何,有沒有強迫“ hadoop jar”查看10.1.1.4而不是127.0.0.1?

我的NameNode,DataNode,JobTracker,TaskTracker等都在運行。 我什至在從屬服務器上檢查了DataNode和TaskTracker,它們似乎都在工作。 我可以在主服務器上檢查WebUI,它顯示我的集群在線。

我希望問題與DNS有關,因為似乎“ hadoop jar”命令找到了正確的端口,但始終使用127.0.0.1地址而不是10.1.1.4。

更新

core-site.xml中進行配置

<configuration>

<property>
  <name>hadoop.tmp.dir</name>
  <value>/app/hadoop/tmp</value>
  <description>A base for other temporary directories.</description>
</property>

<property>
  <name>fs.default.name</name>
  <value>hdfs://master:54310</value>
  <description>The name of the default file system.  A URI whose
  scheme and authority determine the FileSystem implementation.  The
  uri's scheme determines the config property (fs.SCHEME.impl) naming
  the FileSystem implementation class.  The uri's authority is used to
  determine the host, port, etc. for a filesystem.</description>
</property>

</configuration>

mapred-site.xml中進行配置

<configuration>

<property>
  <name>mapred.job.tracker</name>
  <value>master:54311</value>
  <description>The host and port that the MapReduce job tracker runs
  at.  If "local", then jobs are run in-process as a single map
  and reduce task.
  </description>
</property>

</configuration>

hdfs-site.xml中進行配置

<configuration>

<property>
  <name>dfs.replication</name>
  <value>1</value>
  <description>Default block replication.
  The actual number of replications can be specified when the file is created.
  The default is used if replication is not specified in create time.
  </description>
</property>

</configuration>

盡管這似乎是DNS問題,但實際上是Hadoop試圖解析代碼中對localhost的引用。 我正在部署其他人的罐子,並認為它是正確的。 經過進一步檢查,我找到了對localhost的引用,並將其更改為master,從而解決了我的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM