首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >具有独立hbase的春季hbase样品

具有独立hbase的春季hbase样品
EN

Stack Overflow用户
提问于 2015-08-01 06:54:33
回答 1查看 1K关注 0票数 0

在我的本地dev Ubuntu 14盒中,我无法让hadoop和hbase独立运行。

BUt可以让hbase直接使用文件系统(通过创建表和在hbase外壳中放置值来验证)。

现在我想从春天开始读这张桌子。我从https://github.com/spring-projects/spring-hadoop-samples/tree/master/hbase的代码开始

如果我将IP和端口更改为qa服务器,它就能工作。但如果我想连接到我当地的hbase无法。

hbase-位点

代码语言:javascript
复制
   <property>
      <name>hbase.rootdir</name>
      <!-- value>hdfs://localhost:50070/hbase</value --> <!-- 8030-->
    <value>file:///usr/local/hbase/HFiles3</value>
   </property>

   <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/usr/local/hbase/zookeeper3</value>
  </property>     

   <property>
    <name>hbase.master.info.port</name>
    <value>8095</value>
  </property>

   <property>
    <name>hbase.regionserver.info.port</name>
    <value>8096</value> <!-- changed as i dont know where it was connecting other wise none of the usual ports -->
  </property>

application-context.xml

代码语言:javascript
复制
    <context:property-placeholder location="hbase.properties"/>

    <context:component-scan base-package="org.springframework.samples.hadoop.hbase"/>

    <hdp:configuration id="hadoopConfiguration">
      fs.defaultFS=file:///usr/local/hbase/HFiles3
    </hdp:configuration>

<!--    configuration-ref="hadoopConfiguration" -->
    <hdp:hbase-configuration configuration-ref="hadoopConfiguration" zk-quorum="${hbase.zk.host}" zk-port="${hbase.zk.port}"/>

    <bean id="hbaseTemplate" class="org.springframework.data.hadoop.hbase.HbaseTemplate">
        <property name="configuration" ref="hbaseConfiguration"/>
    </bean>

hbase.properties

代码语言:javascript
复制
hbase.zk.host=localhost
hbase.zk.port=8095

日志(部分):.

代码语言:javascript
复制
12:20:21,763  INFO           org.apache.zookeeper.ZooKeeper: 100 - Client environment:user.home=/home/t
12:20:21,763  INFO           org.apache.zookeeper.ZooKeeper: 100 - Client environment:user.dir=/home/t/prog/r/github/spring-hadoop-samples/hbase
12:20:21,765  INFO           org.apache.zookeeper.ZooKeeper: 438 - Initiating client connection, connectString=localhost:8095 sessionTimeout=90000 watcher=hconnection-0x5a7fd55c, quorum=localhost:8095, baseZNode=/hbase
12:20:21,802  INFO oop.hbase.zookeeper.RecoverableZooKeeper: 120 - Process identifier=hconnection-0x5a7fd55c connecting to ZooKeeper ensemble=localhost:8095
12:20:21,805  INFO          org.apache.zookeeper.ClientCnxn: 975 - Opening socket connection to server t/127.0.0.1:8095. Will not attempt to authenticate using SASL (unknown error)
12:20:21,828  INFO          org.apache.zookeeper.ClientCnxn: 852 - Socket connection established to t/127.0.0.1:8095, initiating session
12:20:21,834  WARN          org.apache.zookeeper.ClientCnxn:1102 - Session 0x0 for server t/127.0.0.1:8095, unexpected error, closing socket connection and attempting reconnect
java.io.IOException: Packet len1213486160 is out of range!
    at org.apache.zookeeper.ClientCnxnSocket.readLength(ClientCnxnSocket.java:112)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:79)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
12:20:21,947  WARN oop.hbase.zookeeper.RecoverableZooKeeper: 253 - Possibly transient ZooKeeper, quorum=localhost:8095, exception=org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
12:20:21,947  INFO rg.apache.hadoop.hbase.util.RetryCounter: 155 - Sleeping 1000ms before retry #0...
12:20:23,325  INFO          org.apache.zookeeper.ClientCnxn: 975 - Opening socket connection to server t/127.0.0.1:8095. Will not attempt to authenticate using SASL (unknown error)
12:20:23,326  INFO          org.apache.zookeeper.ClientCnxn: 852 - Socket connection established to t/127.0.0.1:8095, initiating session
12:20:23,327  WARN          org.apache.zookeeper.ClientCnxn:1102 - Session 0x0 for server t/127.0.0.1:8095, unexpected error, closing socket connection and attempting reconnect
java.io.IOException: Packet len1213486160 is out of range!

...

我可以在没有hadoop的情况下为本地开发运行spring吗?我是否需要运行一个独立的动物园管理员,并将该端口命名为hbase.zk.port?hbase.zk.port是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-01 07:07:53

在独立模式下,它也连接到2181。来自hbase的日志:

2015-08-01 12:30:36,489 INFO主server.ZooKeeperServer: Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir maxSessionTimeout管理单元/usr/local/hbase/zookeeper3/zookeeper_0/version-2 2015-08-01 12:30:36,504 INFO主server.NIOServerCnxnFactory:绑定到端口0.0.0/0.0.0:2181 2015-08-01 12:30:36,638 INFO NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181 server.NIOServerCnxnFactory:接受来自/127.0.0.1:60489的套接字连接

示例工作-“hadoop”本地文件URL和zk与默认的2181端口

代码语言:javascript
复制
<hdp:configuration id="hadoopConfiguration">
      fs.defaultFS=file:///usr/local/hbase/HFiles3
    </hdp:configuration> 

hbase.zk.port=2181
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31759189

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档