determination*
2018-04-18 23:44
采纳率: 100%
浏览 3.5k
已采纳

Java项目连接hbase时超时

本人小白一枚,现在有个项目是用Java项目连接hbase。我用的是windows下的Java项目连接linux虚拟机上的hbase,hbase开启之后连接提示连接超时(ps:主机之间可互通),求助。。。
log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell).
log4j:WARN Please initialize the log4j system properly.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/E:/apache-tomcat-7.0.85-windows-x64/apache-tomcat-7.0.85/webapps/car_hbase/WEB-INF/lib/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/E:/apache-tomcat-7.0.85-windows-x64/apache-tomcat-7.0.85/webapps/car_hbase/WEB-INF/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
e785dc9437424bf8a7714f460293896c HBASE表创建失败!
java.io.IOException: Failed to get result within timeout, timeout=60000ms
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:232)
at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:58)
at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithoutRetries(RpcRetryingCaller.java:219)
at org.apache.hadoop.hbase.client.ClientScanner.call(ClientScanner.java:277)
at org.apache.hadoop.hbase.client.ClientScanner.loadCache(ClientScanner.java:438)
at org.apache.hadoop.hbase.client.ClientScanner.next(ClientScanner.java:312)
at org.apache.hadoop.hbase.MetaTableAccessor.fullScan(MetaTableAccessor.java:604)
at org.apache.hadoop.hbase.MetaTableAccessor.tableExists(MetaTableAccessor.java:366)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:410)
at org.apache.hadoop.hbase.client.HBaseAdmin.tableExists(HBaseAdmin.java:420)
at util.HBaseUtil.createTable(HBaseUtil.java:45)
at util.HbaseDemo.createTable(HbaseDemo.java:55)
at util.StartupListener.contextInitialized(StartupListener.java:31)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5641)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1015)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2038)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

5条回答 默认 最新

  • qq_36361488 2018-04-19 01:13
    已采纳

    看主机名是不是无法识别,是否需要添加映射

    点赞 打赏 评论
  • 精锐小菜鸡 2018-04-19 01:11

    windows的hosts文件有配置master-slave吗

    点赞 打赏 评论
  • god__send 2018-04-19 01:22

    加入配置文件<?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>


    hbase.zookeeper.quorum
    master,slave1,slave2


    hbase.zookeeper.property.clientPort
    2181


    然后public static final Configuration CONFIGURATION=HBaseConfiguration.create();获取配置

    点赞 打赏 评论
  • 好想打麻将 2018-04-19 01:35

    可能dns解析不对,windows的hosts文件添加:x.x.x.x localhost.localdomain映射试试,x.x.x.x是linux的IP

    点赞 打赏 评论
  • 泪三国云无痕 2018-04-22 00:33

    配置的时候可能是hbase的路径不对,你看下你设置的是不是默认地址,我之前遇到连不上也是用了默认的地址,然后发现我自己的不是

    点赞 打赏 评论

相关推荐 更多相似问题