HBase错误:不是主机:端口对 [英] HBase error: Not a host:port pair

查看:109
本文介绍了HBase错误:不是主机:端口对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在完全分布式模式下使用hBase,并且正在尝试使用java代码连接Hbase并创建一个表。我收到一个错误。它没有连接到hbase。我检查了它们运行正常的所有进程: - namenode,datanode,nodemanager,资源管理器,hbase master,hbase regionservers,动物园管理员。


$ b

错误



 开始... 
获取配置...
12/07/25 18:48:31 WARN hbase.HBaseConfiguration :实例化HBaseConfiguration()已被弃用。请使用HBaseConfiguration#create()构造一个普通的配置
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:zookeeper.version = 3.3.2-1031432,构建于11/05 / 2010 05:32 GMT
12/07/25 18:48:32信息zookeeper.ZooKeeper:客户端环境:host.name = aniket
12/07/25 18:48:32信息zookeeper.ZooKeeper :客户端环境:java.version = 1.7.0_05
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:java.vendor = Oracle Corporation
12/07/25 18: 48:32 INFO zookeeper.ZooKeeper:客户端环境:java.home = / usr / java / jdk1.7.0_05 / jre
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:java。 class.path = /根/工作区/ HBaseTesting / bin中:/usr/lib/hadoop-0.20-mapreduce/hadoop-core.jar:/usr/lib/hadoop/hadoop-common.jar:/根/下载/ google-收集-1.0-RC1 /谷歌收集-1.0-rc1.jar:/root/Downloads/hbase-0.90.5/hbase-0.90.5.jar:/root/Downloads/hbase-0.90.5/lib/activation- 1.1.jar:/root/Downloads/hbase-0.90.5/lib/asm-3.1.jar:/根/向下负载/ HBase的-0.90.5 / lib目录/ Avro的-1.3.3.jar:/root/Downloads/hbase-0.90.5/lib/commons-cli-1.2.jar:/root/Downloads/hbase-0.90.5/ LIB /公地编解码器1.4.jar:/root/Downloads/hbase-0.90.5/lib/commons-el-1.0.jar:/root/Downloads/hbase-0.90.5/lib/commons-httpclient-3.1。罐子:/root/Downloads/hbase-0.90.5/lib/commons-lang-2.5.jar:/root/Downloads/hbase-0.90.5/lib/commons-logging-1.1.1.jar:/根/下载/hbase-0.90.5/lib/commons-net-1.4.1.jar:/root/Downloads/hbase-0.90.5/lib/core-3.1.1.jar:/root/Downloads/hbase-0.90.5 /lib/guava-r06.jar:/root/Downloads/hbase-0.90.5/lib/hadoop-core-0.20-append-r1056497.jar:/root/Downloads/hbase-0.90.5/lib/jackson-core -asl-1.5.5.jar:/root/Downloads/hbase-0.90.5/lib/jackson-jaxrs-1.5.5.jar:/root/Downloads/hbase-0.90.5/lib/jackson-mapper-asl -1.4.2.jar:/root/Downloads/hbase-0.90.5/lib/jackson-xc-1.5.5.jar:/root/Downloads/hbase-0.90.5/lib/jasper-compiler-5.5.23的.jar:/root/Downloads/hbase-0.90.5/lib/jasper-runtime-5.5.23.jar:/root/Downloads/hbase-0.90.5/lib/jaxb-api-2.1.jar:/根/ d ownloads / HBase的-0.90.5 / LIB / JAXB-IMPL-2.1.12.jar:/root/Downloads/hbase-0.90.5/lib/jersey-core-1.4.jar:/root/Downloads/hbase-0.90。 5 / LIB / Jersey的JSON-1.4.jar:/root/Downloads/hbase-0.90.5/lib/jersey-server-1.4.jar:/root/Downloads/hbase-0.90.5/lib/jettison-1.1。罐子:/root/Downloads/hbase-0.90.5/lib/jetty-6.1.26.jar:/root/Downloads/hbase-0.90.5/lib/jetty-util-6.1.26.jar:/根/下载/hbase-0.90.5/lib/jruby-complete-1.6.0.jar:/root/Downloads/hbase-0.90.5/lib/jsp-2.1-6.1.14.jar:/root/Downloads/hbase-0.90 0.5 / LIB / JSP-API-2.1-6.1.14.jar:/root/Downloads/hbase-0.90.5/lib/jsr311-api-1.1.1.jar:/root/Downloads/hbase-0.90.5 /lib/log4j-1.2.16.jar:/root/Downloads/hbase-0.90.5/lib/protobuf-java-2.3.0.jar:/root/Downloads/hbase-0.90.5/lib/servlet-api -2.5-6.1.14.jar:/root/Downloads/hbase-0.90.5/lib/slf4j-api-1.5.8.jar:/root/Downloads/hbase-0.90.5/lib/slf4j-log4j12-1.5 .8.jar:/root/Downloads/hbase-0.90.5/lib/stax-api-1.0.1.jar:/root/Downloads/hbase-0.90.5/lib/thrift-0.2.0.jar:/根/下载/ HBase的-0.90.5 / LIB / xmlen c-0.52.jar:/root/Downloads/hbase-0.90.5/lib/zookeeper-3.3.2.jar:/root/Downloads/hbql-0.90.0.1/hbql-0.90.0.1.jar
12 / 07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:java.library.path = / usr / java / packages / lib / amd64:/ usr / lib64:/ lib64:/ lib:/ usr / lib $ / b $ b 12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:java.io.tmpdir = / tmp
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:java.compiler = LT; NA>
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:os.name = Linux
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:os .arch = amd64
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:os.version = 2.6.18-274.el5xen
12/07/25 18:48: 32 INFO zookeeper.ZooKeeper:客户端环境:user.name = root
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:user.home = / root
12/07 / 25 18:48:32 INFO zookeeper.ZooKeeper:客户端环境:user.dir = / root / workspace / HBaseTesting
12/07/25 18:48:32 INFO zookeeper.ZooKeeper:启动客户端连接,connectString = 192.168 .1.88:2181 sessionTimeout = 180000 watcher = hconnection
12/07/25 18:48:32 INFO zookeeper.ClientCnxn:打开套接字连接到服务器/192.168.1.88:2181
12/07/25 18 :48:32 INFO zookeeper.ClientCnxn:Socket连接建立到aniket / 192.168.1.88:2181,启动会话
12/07/25 18:48:32 INFO zookeeper.ClientCnxn:会话建立完成在服务器aniket / 192.168.1.88:2181,sessionid = 0x138bf7676070043,协商超时= 40000
线程main中的异常java.lang.IllegalArgumentException:不是主机:端口对:
at org.apache .hdoop.hbase.HServerAddress。< init>(HServerAddress.java:60)
at org.apache.hadoop.hbase.MasterAddressTracker.getMasterAddress(MasterAddressTracker.java:63)
at org.apache。 hadoop.hbase.client.HConnectionManager $ HConnectionImplementation.getMaster(HConnectionManager.java:561)
at org.apache.hadoop.hbase.client.HBaseAdmin。< init>(HBaseAdmin.java:99)
org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:1320)
at HBaseCreateTable.main(HBaseCreateTable.java:38)
$ b

代码片段



 配置config = HBaseConfiguration.create(); 
config.set(hbase.zookeeper.quorum,192.168.1.88);
config.set(hbase.zookeeper.property.clientPort,2181);
config.set(hbase.master,192.168.1.88:60000);
HTableDescriptor ht = new HTableDescriptor(abc);
ht.addFamily(新的HColumnDescriptor(数字)); //从和到
HBaseAdmin hba = new HBaseAdmin(conf);
hba.createTable(ht);


解决方案

当使用0.90.2客户端与0.92服务器交谈时。你能证实你的客户端和服务器HBase版本是一样的吗?它们是什么?


Hi I am using hBase in fully distributed mode and i am trying to connect Hbase using a java code and create a table. I get an error. Its not connecting to hbase. I have checked all the processes they are running fine:- namenode, datanode, nodemanager, resource manager, hbase master, hbase regionservers, zookeeper.

Error

starting...
getting config...
12/07/25 18:48:31 WARN hbase.HBaseConfiguration: instantiating HBaseConfiguration() is deprecated. Please use HBaseConfiguration#create() to construct a plain Configuration
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:zookeeper.version=3.3.2-1031432, built on 11/05/2010 05:32 GMT
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:host.name=aniket
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.version=1.7.0_05
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.vendor=Oracle Corporation
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.home=/usr/java/jdk1.7.0_05/jre
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.class.path=/root/workspace/HBaseTesting/bin:/usr/lib/hadoop-0.20-mapreduce/hadoop-core.jar:/usr/lib/hadoop/hadoop-common.jar:/root/Downloads/google-collect-1.0-rc1/google-collect-1.0-rc1.jar:/root/Downloads/hbase-0.90.5/hbase-0.90.5.jar:/root/Downloads/hbase-0.90.5/lib/activation-1.1.jar:/root/Downloads/hbase-0.90.5/lib/asm-3.1.jar:/root/Downloads/hbase-0.90.5/lib/avro-1.3.3.jar:/root/Downloads/hbase-0.90.5/lib/commons-cli-1.2.jar:/root/Downloads/hbase-0.90.5/lib/commons-codec-1.4.jar:/root/Downloads/hbase-0.90.5/lib/commons-el-1.0.jar:/root/Downloads/hbase-0.90.5/lib/commons-httpclient-3.1.jar:/root/Downloads/hbase-0.90.5/lib/commons-lang-2.5.jar:/root/Downloads/hbase-0.90.5/lib/commons-logging-1.1.1.jar:/root/Downloads/hbase-0.90.5/lib/commons-net-1.4.1.jar:/root/Downloads/hbase-0.90.5/lib/core-3.1.1.jar:/root/Downloads/hbase-0.90.5/lib/guava-r06.jar:/root/Downloads/hbase-0.90.5/lib/hadoop-core-0.20-append-r1056497.jar:/root/Downloads/hbase-0.90.5/lib/jackson-core-asl-1.5.5.jar:/root/Downloads/hbase-0.90.5/lib/jackson-jaxrs-1.5.5.jar:/root/Downloads/hbase-0.90.5/lib/jackson-mapper-asl-1.4.2.jar:/root/Downloads/hbase-0.90.5/lib/jackson-xc-1.5.5.jar:/root/Downloads/hbase-0.90.5/lib/jasper-compiler-5.5.23.jar:/root/Downloads/hbase-0.90.5/lib/jasper-runtime-5.5.23.jar:/root/Downloads/hbase-0.90.5/lib/jaxb-api-2.1.jar:/root/Downloads/hbase-0.90.5/lib/jaxb-impl-2.1.12.jar:/root/Downloads/hbase-0.90.5/lib/jersey-core-1.4.jar:/root/Downloads/hbase-0.90.5/lib/jersey-json-1.4.jar:/root/Downloads/hbase-0.90.5/lib/jersey-server-1.4.jar:/root/Downloads/hbase-0.90.5/lib/jettison-1.1.jar:/root/Downloads/hbase-0.90.5/lib/jetty-6.1.26.jar:/root/Downloads/hbase-0.90.5/lib/jetty-util-6.1.26.jar:/root/Downloads/hbase-0.90.5/lib/jruby-complete-1.6.0.jar:/root/Downloads/hbase-0.90.5/lib/jsp-2.1-6.1.14.jar:/root/Downloads/hbase-0.90.5/lib/jsp-api-2.1-6.1.14.jar:/root/Downloads/hbase-0.90.5/lib/jsr311-api-1.1.1.jar:/root/Downloads/hbase-0.90.5/lib/log4j-1.2.16.jar:/root/Downloads/hbase-0.90.5/lib/protobuf-java-2.3.0.jar:/root/Downloads/hbase-0.90.5/lib/servlet-api-2.5-6.1.14.jar:/root/Downloads/hbase-0.90.5/lib/slf4j-api-1.5.8.jar:/root/Downloads/hbase-0.90.5/lib/slf4j-log4j12-1.5.8.jar:/root/Downloads/hbase-0.90.5/lib/stax-api-1.0.1.jar:/root/Downloads/hbase-0.90.5/lib/thrift-0.2.0.jar:/root/Downloads/hbase-0.90.5/lib/xmlenc-0.52.jar:/root/Downloads/hbase-0.90.5/lib/zookeeper-3.3.2.jar:/root/Downloads/hbql-0.90.0.1/hbql-0.90.0.1.jar
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA>
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:os.version=2.6.18-274.el5xen
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:user.name=root
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:user.home=/root
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Client environment:user.dir=/root/workspace/HBaseTesting
12/07/25 18:48:32 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=192.168.1.88:2181 sessionTimeout=180000 watcher=hconnection
12/07/25 18:48:32 INFO zookeeper.ClientCnxn: Opening socket connection to server /192.168.1.88:2181
12/07/25 18:48:32 INFO zookeeper.ClientCnxn: Socket connection established to aniket/192.168.1.88:2181, initiating session
12/07/25 18:48:32 INFO zookeeper.ClientCnxn: Session establishment complete on server aniket/192.168.1.88:2181, sessionid = 0x138bf7676070043, negotiated timeout = 40000
Exception in thread "main" java.lang.IllegalArgumentException: Not a host:port pair: �
at org.apache.hadoop.hbase.HServerAddress.<init>(HServerAddress.java:60)
    at org.apache.hadoop.hbase.MasterAddressTracker.getMasterAddress(MasterAddressTracker.java:63)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:561)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:99)
    at org.apache.hadoop.hbase.client.HBaseAdmin.checkHBaseAvailable(HBaseAdmin.java:1320)
    at HBaseCreateTable.main(HBaseCreateTable.java:38)

code snippet

Configuration config=HBaseConfiguration.create();
config.set("hbase.zookeeper.quorum", "192.168.1.88");
config.set("hbase.zookeeper.property.clientPort","2181");
config.set("hbase.master", "192.168.1.88:60000");
HTableDescriptor ht = new HTableDescriptor( "abc" );
ht.addFamily( new HColumnDescriptor( "number" ) ); // from and to
HBaseAdmin hba = new HBaseAdmin( conf );
hba.createTable( ht );

解决方案

I've seen "not a host:port pair" when using 0.90.2 client to talk to 0.92 server. Can you verify that your client and server HBase versions are the same, and what are they?

这篇关于HBase错误:不是主机:端口对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆