首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在mac os x 10.8上设置hadoop时出现的问题

问在mac os x 10.8上设置hadoop时出现的问题
EN

Stack Overflow用户
提问于 2013-02-18 17:13:09
回答 3查看 2.8K关注 0票数 0

我已经在我的mac上设置了一些东西来安装hadoop。但是有一条错误消息是这样的:

代码语言:javascript
复制
13/02/18 04:05:52 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 0 time(s).
13/02/18 04:05:53 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 1 time(s).
13/02/18 04:05:54 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 2 time(s).
13/02/18 04:05:55 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 3 time(s).
13/02/18 04:05:56 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 4 time(s).
13/02/18 04:05:57 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 5 time(s).
13/02/18 04:05:58 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 6 time(s).
13/02/18 04:05:59 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 7 time(s).
13/02/18 04:06:00 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 8 time(s).
13/02/18 04:06:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:9000. Already tried 9 time(s).
java.lang.RuntimeException: java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused
    at org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:546)
    at org.apache.hadoop.mapred.FileInputFormat.setInputPaths(FileInputFormat.java:318)
    at org.apache.hadoop.examples.PiEstimator.estimate(PiEstimator.java:265)
    at org.apache.hadoop.examples.PiEstimator.run(PiEstimator.java:342)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
    at org.apache.hadoop.examples.PiEstimator.main(PiEstimator.java:351)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
    at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
    at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.net.ConnectException: Call to localhost/127.0.0.1:9000 failed on connection exception: java.net.ConnectException: Connection refused
    at org.apache.hadoop.ipc.Client.wrapException(Client.java:1099)
    at org.apache.hadoop.ipc.Client.call(Client.java:1075)
    at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
    at $Proxy1.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
    at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:238)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:203)
    at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:123)
    at org.apache.hadoop.mapred.JobConf.getWorkingDirectory(JobConf.java:542)
    ... 17 more
Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:489)
    at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:434)
    at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:560)
    at org.apache.hadoop.ipc.Client$Connection.access$2000(Client.java:184)
    at org.apache.hadoop.ipc.Client.getConnection(Client.java:1206)
    at org.apache.hadoop.ipc.Client.call(Client.java:1050)
    ... 31 more

然后进入jps检查服务,结果是: 20635 Jps

20466 TaskTracker

20189 DataNode

20291 SecondaryNameNode

我不知道如何处理这个错误。有人能给我一个答案吗?非常感谢!

EN

回答 3

Stack Overflow用户

发布于 2013-02-18 17:50:14

实际上,(hadoop应该运行的)所有进程都没有运行,因为in配置错误。我不熟悉Mac,但在linux和windows上,我们需要将hadoop enteries放在主机文件(etc/ hosts )中进行连接,我非常确定这应该是针对Mac.Now的。

您需要将hadoop条目作为本地机器放入该文件中,如127.0.0.1

实际上,您需要将其与您机器的实际IP放在一起

例如

hadoop-machine 127.0.0.1 -->(此处放置环回IP是错误的,因为hadoop将尝试连接此IP)。

删除这个127.0.0.1,并将您机器的实际IP放在此条目的前面。You can find ip of your mac machine eaisly.here是一些与hadoop没有直接关系的问题,但我猜它们会对您有所帮助。

Question 1、Question 2、Question 3

票数 2
EN

Stack Overflow用户

发布于 2013-10-11 02:07:03

这可能会有一点帮助。但首先必须使用以下命令删除较早的安装

rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup

然后你可以开始在你的Mac上重新安装Hadoop。

步骤1:安装Homebrew

curl$

-e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)“

第2步:安装Hadoop

$ brew安装hadoop

假设brew安装了Hadoop 1.2.1

第3步:配置Hadoop

$ cd /usr/local/Cellar/hadoop/1.2.1/libexec

在conf/hadoop-env.sh中添加以下行:

导出HADOOP_OPTS="-Djava.security.krb5.realm= -Djava.security.krb5.kdc=“

将以下行添加到conf/core-site.xml的配置标记内:

fs.default.name hdfs://本地主机:9000

将以下行添加到conf/hdfs-site.xml的配置标记内:

dfs.replication 1

将以下行添加到conf/mapred-site.xml的配置标记内:

mapred.job.tracker本地主机:9001

转到系统首选项>共享。确保选中“Remote Login”。

$ ssh-keygen -t rsa $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/_key

第4步:启用对本地主机的SSH

授权密钥$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/

_key

步骤5:格式化Hadoop文件系统

hadoop$

/hadoop名称节点-format

第6步:启动Hadoop

$ bin/start-all.sh

确保所有Hadoop进程都在运行:

$ jps

运行Hadoop示例:

还有一件事!“brew update”将hadoop二进制文件更新到最新版本(目前为1.2.1)。

票数 1
EN

Stack Overflow用户

发布于 2015-10-26 01:21:03

我遇到了同样的错误:在所有的辅助名称节点日志文件中出现了ConnectException: Connection refused。

但我还在namenode的日志文件中发现了以下内容:

代码语言:javascript
复制
2015-10-25 16:35:15,720 ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: Failed to start namenode.
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /private/tmp/hadoop-admin/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.

因此,我做了一个

代码语言:javascript
复制
hadoop namenode -format

而且这个问题已经消失了。因此,错误消息只是关于namenode没有成功启动的事实。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14932794

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档