【发布时间】:2012-01-11 11:15:34
【问题描述】:
我目前正在尝试在 HDFS 和 HBASE 上工作。 Hadoop 和 HBASE 已正确安装在一台机器上,当托管在同一台机器上时,我的应用程序可以完美运行。
但是当托管在另一台机器上时。在第一次访问 HBASE 时,我收到一条错误消息:
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [sitepulsewebsite] in context with path [/SitePulseWeb] threw exception [Request processing failed; nested exception is javax.jdo.JDODataStoreException
NestedThrowables:org.apache.hadoop.hbase.MasterNotRunningException: localhost:60000] with root cause
org.apache.hadoop.hbase.MasterNotRunningException: localhost:60000
在第二次命中时,我得到了异常:
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [sitepulsewebsite] in context with path [/SitePulseWeb] threw exception [Request processing failed; nested exception is javax.jdo.JDODataStoreException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to localhost/127.0.0.1:60020 after attempts=1
NestedThrowables: org.apache.hadoop.hbase.client.RetriesExhaustedException: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to localhost/127.0.0.1:60020 after attempts=1] with root cause
java.net.ConnectException: Connection refused
我的 hbase-site.xml 内容如下:
<configuration>
<property>
<name>hbase.rootdir</name>
<value>hdfs://master:54310/hbase </value>
<description>
The directory shared by region servers. Should be
fully-qualified to
include the filesystem to use. E.g:
hdfs://NAMENODE_SERVER:PORT/HBASE_ROOTDIR
</description>
</property>
<property>
<name>hbase.cluster.distributed</name>
<value>true</value>
<description>The mode the cluster will be in. Possible values are
false: standalone and pseudo-distributed setups with managed
Zookeeper
true: fully-distributed with unmanaged Zookeeper Quorum (see
hbase-env.sh)
</description>
</property>
<property>
<name>hbase.zookeeper.quorum</name>
<value>master</value>
<description>Comma separated list of servers in the ZooKeeper Quorum.
If HBASE_MANAGES_ZK is set in hbase-env.sh this is the list of
servers which we will start/stop ZooKeeper on.
</description>
</property>
<property>
<name>hbase.master</name>
<value>master:60010</value>
</property>
<property>
<name>hbase.zookeeper.property.clientPort</name>
<value>2181</value>
</property></configuration>
更新日志
查看我的 Java 应用程序创建的日志(调试级别),我发现了以下日志:
1 2012-01-12 17:12:13,328 DEBUG Thread-1320 org.apache.hadoop.ipc.HBaseClient - IPC Client (47) connection to localhost/127.0.0.1:60020 from an unknown user: closed
2 2012-01-12 17:12:13,328 INFO Thread-1320 org.apache.hadoop.ipc.HbaseRPC - Server at localhost/127.0.0.1:60020 could not be reached after 1 tries, giving up.
3 2012-01-12 17:12:13,328 DEBUG Thread-1320 org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation - locateRegionInMeta parentTable=-ROOT-, metaLocation=address: localhost:60020, regioninfo: -ROOT-,,0.70236052, attempt=0 of 10 failed; retrying after sleep of 1000 because: Failed setting up proxy interface org.apache.hadoop.hbase.ipc.HRegionInterface to localhost/127.0.0.1:60020 after attempts=1
4 2012-01-12 17:12:13,328 DEBUG Thread-1320 org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation - Lookedup root region location, connection=org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@9d1e83; hsa=localhost:60020
5 2012-01-12 17:12:13,736 DEBUG Thread-1268 org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation - Lookedup root region location, connection=org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@9d1e83; hsa=localhost:60020
6 2012-01-12 17:12:13,736 DEBUG Thread-1268 org.apache.hadoop.ipc.HBaseClient - Connecting to localhost/127.0.0.1:60020
7 2012-01-12 17:12:13,737 DEBUG Thread-1268 org.apache.hadoop.ipc.HBaseClient - closing ipc connection to localhost/127.0.0.1:60020: Connection refused
8 java.net.ConnectException: Connection refused
在 /etc/hosts 文件中 当映射从
更改时127.0.0.1 localhost
到
<my_server_IP> localhost
我的应用程序运行良好。因此,我需要一些方法来告诉应用程序连接到所需的主机名而不是 localhost。
我试过调试它,没有任何成功。
【问题讨论】:
-
所以我很困惑。你解决问题了吗?事实证明,有几件事会导致该错误。
-
不,我没有解决,我无法将 localhost 映射到我的服务器的 IP,因为当应用程序开始生产时,系统上运行的其他应用程序期望 localhost 是自己的系统将会中断。跨度>
-
是的,我在两个系统上都禁用了,并且还通过 cat /proc/sys/net/ipv6/conf/all/disable_ipv6 验证,输出为 1
标签: java hadoop jdo hbase datanucleus