dev*_*sri 3 java hadoop hbase jdo datanucleus
我目前正在尝试使用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
Run Code Online (Sandbox Code Playgroud)
在第二次打击我得到例外:
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
Run Code Online (Sandbox Code Playgroud)
我的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>
Run Code Online (Sandbox Code Playgroud)
更新日志
查看我的Java应用程序创建的日志(DEBUG级别),我发现了以下日志:
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
Run Code Online (Sandbox Code Playgroud)
在映射更改时的/ etc/hosts文件中
127.0.0.1 localhost
Run Code Online (Sandbox Code Playgroud)
至
<my_server_IP> localhost
Run Code Online (Sandbox Code Playgroud)
我的应用工作得非常好.因此,我需要一些方法来告诉应用程序连接到所需的主机名而不是localhost.
我试过调试它,没有任何成功.
我不知道这是不是你的问题,但如果你没有从同一台主机访问所有东西,那么使用localhost通常是个问题.
所以不要使用localhost!
并且一般不要更改localhost的定义.默认情况下,Localhost是127.0.0.1.
您将hbase.rootdir定义为hdfs:// master:54310/hbase和hbase.zookeeper.quorum作为master.
什么是主人?它应该是主机主要以太网接口的完全限定域名.该接口的IP地址的反向DNS应解析为您填写到这些字段的相同FQDN.(或者如果你无法控制反向dns,只需使用原始IP地址)
确保您的HDFS配置也使用相同的FQDN或IP地址或同步的/ etc/hosts文件.同步/ etc/hosts文件应该确保正向和反向DNS是相同的,只要所有主机(所有HDFS和HBase和您的客户端)使用相同的/ etc/hosts并且没有覆盖/ etc的操作系统内容/主机.一般来说,我不喜欢用/ etc/hosts做任何事情.它最终会咬你.
然后,您的远程客户端应通过相同的FQDN或IP地址访问您的HBase主服务器.
我发现这种DNS问题可能会导致相当多的混乱.
如果您需要进行现实检查,只需在任何地方使用IP地址,直到您完成它为止.然后尝试使用完全限定域名或同步/ etc/hosts文件.
| 归档时间: |
|
| 查看次数: |
7951 次 |
| 最近记录: |