2

这发生在伪分布式和分布式模式中。当我尝试启动 HBase 时,最初所有 3 个服务 - 主服务器、区域和 quorumpeer 都会启动。然而,不到一分钟,主人就停下了。在日志中,这是跟踪 -

2013-05-06 20:10:25,525 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 0 time(s).
2013-05-06 20:10:26,528 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 1 time(s).
2013-05-06 20:10:27,530 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 2 time(s).
2013-05-06 20:10:28,533 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 3 time(s).
2013-05-06 20:10:29,535 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 4 time(s).
2013-05-06 20:10:30,538 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 5 time(s).
2013-05-06 20:10:31,540 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 6 time(s).
2013-05-06 20:10:32,543 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 7 time(s).
2013-05-06 20:10:33,544 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 8 time(s).
2013-05-06 20:10:34,547 INFO org.apache.hadoop.ipc.Client: Retrying connect to server: <master/master_ip>:9000. Already tried 9 time(s).
2013-05-06 20:10:34,550 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
java.net.ConnectException: Call to <master/master_ip>:9000 failed on connection exception: java.net.ConnectException: Connection refused
        at org.apache.hadoop.ipc.Client.wrapException(Client.java:1179)
        at org.apache.hadoop.ipc.Client.call(Client.java:1155)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:226)
        at $Proxy9.getProtocolVersion(Unknown Source)
        at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:398)
        at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:384)
        at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:132)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:259)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:220)
        at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1611)
        at org.apache.hadoop.fs.FileSystem.access$300(FileSystem.java:68)
        at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:1645)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1627)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
        at org.apache.hadoop.fs.Path.getFileSystem(Path.java:183)
        at org.apache.hadoop.hbase.util.FSUtils.getRootDir(FSUtils.java:363)
        at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSystem.java:86)
        at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.java:368)
        at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:301)
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:592)
        at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
        at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:519)
        at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:484)
        at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:468)
        at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:575)
        at org.apache.hadoop.ipc.Client$Connection.access$2300(Client.java:212)
        at org.apache.hadoop.ipc.Client.getConnection(Client.java:1292)
        at org.apache.hadoop.ipc.Client.call(Client.java:1121)
        ... 18 more

我已采取措施解决此问题,但没有成功 - 从分布式模式降级为伪分布式模式。同样的问题。- 尝试了独立模式 - 没有运气 - 对 hadoop 和 hbase 使用相同的用户 (hadoop)。为 hadoop 设置无密码 ssh。- 同样的问题。- 编辑 /etc/hosts 文件并将 localhost/servername 以及 127.0.0.1 更改为引用 SO 和不同来源的实际 IP 地址。还是同样的问题。- 重新启动服务器

这是conf文件。

hbase-site.xml

<configuration>
<property>
  <name>hbase.rootdir</name>
  <value>hdfs://<master>:9000/hbase</value>
        <description>The directory shared by regionservers.</description>
</property>

<property>
        <name>hbase.cluster.distributed</name>
        <value>true</value>
</property>

<property>
        <name>hbase.zookeeper.quorum</name>
        <value><master></value>
</property>

<property>
        <name>hbase.master</name>
        <value><master>:60000</value>
        <description>The host and port that the HBase master runs at.</description>
</property>

<property>
        <name>dfs.replication</name>
        <value>1</value>
        <description>The replication count for HLog and HFile storage. Should not be greater than HDFS datanode count.</description>
</property>

</configuration>

/etc/hosts 文件

127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 。

我在这里做错了什么?

Hadoop 版本 - Hadoop 0.20.2-cdh3u5 HBase 版本 - 版本 0.90.6-cdh3u5

4

2 回答 2

5

通过查看您的配置文件,我假设您在配置文件中使用了实际的主机名。如果是这种情况,请将主机名连同机器的 IP 添加到 /etc/hosts 文件中。还要确保它与 Hadoop 的 core-site.xml 中的主机名匹配。正确的名称解析对于正确的 HBase 功能至关重要。

如果您仍然遇到任何问题,请正确执行此处提到的步骤。我已尝试详细解释该过程,如果您仔细遵循所有步骤,希望您能够使其运行。

高温高压

于 2013-05-06T15:43:29.480 回答
-1

我相信您正在尝试使用伪分布式模式。在修复 3 件事之前,我遇到了同样的错误:

  1. 本地 /etc/hosts 文件

$ 猫 /etc/hosts

127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0 localhost
172.20.x.x  my.hostname.com
  1. 而不是指向主机名,而是指向 hbase-env.sh 中的 localhost

  2. 更正我的类路径 A. 确保 Hadoop 在类路径中(通过 hbase-env.sh)

    export JAVA_HOME=你到 java home 的路径 export HADOOP_HOME=你到 hadoop home 的路径 export HBASE_HOME=你到 hbase home 的路径

    export HBASE_CLASSPATH=你到 hbase home/conf 的路径:你到 hadoop home/conf 的路径

B. 运行我的程序时,我从 HBase 编辑了以下 bash 脚本:权威指南 (bin/run.sh) $ grep -v # bin/run.sh

bin=`dirname "$0"`
bin=`cd "$bin">/dev/null; pwd`

  echo "usage: $(basename $0) <example-name>"
  exit 1;
fi

MVN="mvn"
if [ "$MAVEN_HOME" != "" ]; then
  MVN=${MAVEN_HOME}/bin/mvn
fi

CLASSPATH="${HBASE_CONF_DIR}"

if [ -d "${bin}/../target/classes" ]; then
  CLASSPATH=${CLASSPATH}:${bin}/../target/classes
fi

cpfile="${bin}/../target/cached_classpath.txt"
if [ ! -f "${cpfile}" ]; then
  ${MVN} -f "${bin}/../pom.xml" dependency:build-classpath -Dmdep.outputFile="${cpfile}" &> /dev/null
fi
CLASSPATH=`hbase classpath`:${CLASSPATH}:`cat "${cpfile}"`

JAVA_HOME=your path to java home
JAVA=$JAVA_HOME/bin/java
JAVA_HEAP_MAX=-Xmx512m

echo "Classpath is $CLASSPATH"
"$JAVA" $JAVA_HEAP_MAX -classpath "$CLASSPATH" "$@"

值得注意的是,我使用的是 Mac。我相信这些说明也适用于 Linux。

于 2013-09-01T14:31:19.693 回答