java连hbase永久等待问题

只有一个有价值信息就是,Session establishment complete on server tb86-es01/172.18.1.86:2181, sessionid = 0x15b79d49b158594, negotiated timeout = 40000
代码如下:
public class extract_hbase_job {
private static Configuration hconf = null;

static{
Configuration conf = new Configuration();
conf.set("hbase.zookeeper.quorum", "tb86-es01,tb87-es02,tb88-es03");
conf.set("hbase.zookeeper.property.clientPort", "2181");
System.setProperty("hadoop.home.dir", "D:\work\apache\hadoop\hadoop-2.6.0");

       hconf = HBaseConfiguration.create(conf);
   }

    public static void getRecord(String tableName,String rowKey) throws Exception{
      HTable table = new HTable(hconf, tableName.getBytes());
      Get get = new Get(rowKey.getBytes());
      Result rs = table.get(get);
     for (KeyValue kv : rs.raw()) {
        System.out.println(new String(kv.getQualifier()) + " " );
    }
 @Test
  public void test() throws Exception{
      extract_hbase_job.getRecord("default:relation_graph", "00:global:cp:10878983");
  }

}

hbase中也有报错:
java.lang.RuntimeException: Failed construction of Master: class org.apache.hadoop.hbase.master.HMaster
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1867)
at org.apache.hadoop.hbase.master.HMasterCommandLine.startMaster(HMasterCommandLine.java:198)
at org.apache.hadoop.hbase.master.HMasterCommandLine.run(HMasterCommandLine.java:139)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.hadoop.hbase.util.ServerCommandLine.doMain(ServerCommandLine.java:126)
at org.apache.hadoop.hbase.master.HMaster.main(HMaster.java:1881)
ed by: java.net.BindException: 地址已在使用
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.hadoop.hbase.ipc.RpcServer.bind(RpcServer.java:2366)
at org.apache.hadoop.hbase.ipc.RpcServer$Listener.(RpcServer.java:524)
at org.apache.hadoop.hbase.ipc.RpcServer.(RpcServer.java:1896)

at org.apache.hadoop.hbase.regionserver.RSRpcServices.(RSRpcServices.java:788)
at org.apache.hadoop.hbase.master.MasterRpcServices.(MasterRpcServices.java:197)
at org.apache.hadoop.hbase.master.HMaster.createRpcServices(HMaster.java:401)
at org.apache.hadoop.hbase.regionserver.HRegionServer.(HRegionServer.java:487)
at org.apache.hadoop.hbase.master.HMaster.(HMaster.java:271)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.hbase.master.HMaster.constructMaster(HMaster.java:1862)
... 5 more

3个回答

有没有那个大神遇见过,我已经把host文件改了,而且jar包直接用的hbase的lib目录中的jar包

我的zk和hbase部是在同一台机器上,代码中写的地址是zk的集群

wo ye yiyang chu wen ti l

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问