标签: hbase

使用主机系统上的客户端访问VM中运行的HBase

我尝试用客户端程序将一些数据写入hbase

HBase @ Hadoop在Cloudera @ ubuntu的预配置VM中运行.

客户端在托管VM的系统上运行,并直接在VM中运行客户端.

所以现在我想使用vm之外的客户端来访问vm上的服务器

我正在使用NAT.为了能够访问像HBase Master这样的服务器,HUE ...在vm上运行我在虚拟框中配置了端口转发:在此输入图像描述

因此,我可以访问HBase Master的概述站点,HUE ..

要针对vm上的服务器运行客户端,我创建了带有内容的hbase-site.xml:

<configuration>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>localhost</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>9997</value>
    </property>
    <property>
        <name>hbase.master</name>
        <value>localhost:9999</value>
    </property>
</configuration>
Run Code Online (Sandbox Code Playgroud)

所以我期望转发工作:

运行客户端时日志中的错误消息如下所示:

11/09/07 17:48:00 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
11/09/07 17:48:00 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
11/09/07 17:48:01 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:567)
    at …
Run Code Online (Sandbox Code Playgroud)

hadoop hbase virtualbox cloudera

6
推荐指数
1
解决办法
8279
查看次数

从hbase行检索时间戳

使用Hbase API(Get/Put)或HBQL API,是否可以检索特定列的时间戳?

java hbase flume

6
推荐指数
1
解决办法
1万
查看次数

如何在HBase集群中获取regionservers的startcode?

我的HBase集群的负载不平衡,所以我想将表的某些区域从一个regionserver移动到另一个,但是看起来需要一个regionserver的起始码来完成这个,我怎样才能得到这个起始码?

我注意到有人的主状态页面是这样的: 其他的主状态页面

但我的是这样的: 我的主状态页面

我在哪里可以得到起始码?

实际上,我想将一个区域从regionserver k3移动到regionserver k2,而k3上的区域是: k3上的地区

我怎样才能做到这一点?详细地 :)

hbase regions

6
推荐指数
1
解决办法
1727
查看次数

HBase是否使用主索引?

HBase如何执行查找并检索记录?例如,RDBMS的B树在HBase中的等效项是什么?

[编辑]

我了解HBase如何解析-ROOT-和.META。表格以找出哪个区域保存数据。但是如何执行本地查找?

为了更好地说明,这是一个示例:

  1. 我正在使用键77开始搜索(获取或扫描)以进行记录。
  2. HBase客户端认为密钥包含在RegionServer X持有的50-100区域中。
  3. HBase客户端与RegionServer X联系以获取数据。

RegionServer X如何找出记录77的位置?

RegionServer是否使用某种查找表(例如RDBMS的B树)作为区域的键?还是需要读取StoreFiles的所有内容(记录从50到77)?

indexing hbase lookup-tables database-scan

6
推荐指数
1
解决办法
3408
查看次数

HDInsight:HBase还是Azure表存储?

目前我的团队正在创建一个使用HDInsight的解决方案.我们每天将获得5TB的数据,并且需要对这些数据进行一些地图/减少工作.如果我们的数据将存储在Azure表存储而不是Azure HBase中,是否会有任何性能/成本差异?

hadoop hbase azure azure-table-storage hdinsight

6
推荐指数
1
解决办法
3489
查看次数

Phoenix不会正确显示负整数值

我正在创建一个值为整数-17678的HBASE表.但是当我从pheonix中检索它时,它给了我一个不同的正值.RowKey是一个复合rowkey,rowkey没有问题.

Hbase插入:

public class test
{
public static void main(String args[])
{
        Configuration config = HBaseConfiguration.create();

          Connection connection = ConnectionFactory.createConnection(config);
          Table table = connection.getTable(TableName.valueOf("TEST"));
          Integer i=-17678;

          try
          {
          Put p = new Put(Bytes.toBytes("rowkey"));
          p.addColumn(Bytes.toBytes("test"),Bytes.toBytes("test"),Bytes.toBytes(i));
          table.put(p);
          }
          finally
          {
             table.close();
             connection.close();
          }

    }
}
Run Code Online (Sandbox Code Playgroud)

凤凰检索:

从TEST中选择CAST("Value"AS INTEGER);

+------------------------------------------+
|         TO_INTEGER(test."Value")         | 
+------------------------------------------+
| 2147465970                               | 
+------------------------------------------+
Run Code Online (Sandbox Code Playgroud)

这里有什么不对吗?还是凤凰问题?

java serialization hadoop hbase phoenix

6
推荐指数
1
解决办法
795
查看次数

Java API到HBase异常:无法获取位置

我正在尝试使用JAVA API连接到HBase.我的代码如下所示:

public class Test {
    public static void main(String[] args) throws IOException{
        TableName tableName = TableName.valueOf("TABLE2");

        Configuration conf = HBaseConfiguration.create();
        conf.set("zookeeper.znode.parent", "/hbase-secure");
        conf.set("hbase.zookeeper.property.clientPort", "2181");
        conf.set("hbase.zookeeper.quorum", "xxxxxxxxxxxxxx");
        conf.set("hbase.master", "xxxxxxxxxxxxx");

        Connection conn = ConnectionFactory.createConnection(conf);
        Admin admin = conn.getAdmin();
        System.out.println(admin.toString());

        if(!admin.tableExists(tableName)){
            admin.createTable(new HTableDescriptor(tableName).addFamily(new HColumnDescriptor("cf")));
        }

        Table table = conn.getTable(tableName);
        Put p = new Put(Bytes.toBytes("AAPL10232015"));
        p.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("close"), Bytes.toBytes(119));
        table.put(p);

        Result r = table.get(new Get(Bytes.toBytes("AAPL10232015")));
        System.out.println(r);
    }
}
Run Code Online (Sandbox Code Playgroud)

当我在我的集​​群中运行这个程序时,我遇到了异常:我运行了这个并得到以下错误:

Exception in thread "main" org.apache.hadoop.hbase.client.RetriesExhaustedException: Can't get the locations
        at org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.getRegionLocations(RpcRetryingCallerWithReadReplicas.java:312)
        at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:151)
        at org.apache.hadoop.hbase.client.ScannerCallableWithReplicas.call(ScannerCallableWithReplicas.java:59) …
Run Code Online (Sandbox Code Playgroud)

java hbase apache-zookeeper

6
推荐指数
1
解决办法
8193
查看次数

Prediction.io - pio列车失败

我正在使用来自sphereio/docker-predictionio docker图像的Prediction.IO的Elasticsearch + Hbase版本 和通用推荐模板template-scala-parallel-universal-recommendation.

pio-start-all并且pio status工作正常,事件服务器功能完善.我创建了一个应用程序并导入了几百个事件.

但是,pio build在完成模板后,pio train未能给出几个javax.naming.NameNotFoundException警告.甚至pio.log不包含任何其他内容.

这是我的engine.json:

{
    "comment": " This config file uses default settings for all but the required values see README.md for docs",
    "id": "default",
    "description": "Default settings",
    "engineFactory": "com.test.RecommendationEngine",
    "datasource": {
        "params": {
            "name": "sample-handmade-data.txt",
            "appName": "testapp",
            "eventNames": ["START"]
        }
    },
    "sparkConf": {
        "spark.serializer": "org.apache.spark.serializer.KryoSerializer",
        "spark.kryo.registrator": "org.apache.mahout.sparkbindings.io.MahoutKryoRegistrator",
        "spark.kryo.referenceTracking": "false",
        "spark.kryoserializer.buffer": "300m",
        "spark.executor.memory": "4g",
        "es.index.auto.create": "true"
    },
    "algorithms": …
Run Code Online (Sandbox Code Playgroud)

hbase scala recommendation-engine elasticsearch predictionio

6
推荐指数
1
解决办法
709
查看次数

使用HBase REST API进行过滤

有没有人知道HBase REST API的任何信息?我正在编写一个程序,使用curl命令从HBase插入和读取.在尝试阅读时,我使用curl get命令,例如

curl -X GET 'http://server:9090/test/Row-1/Action:ActionType/' -h 'Accept:application/json'
Run Code Online (Sandbox Code Playgroud)

这将从Row-1返回Action:ActionType列.如果我想使用GET命令执行等效的WHERE子句,我会被卡住.我不确定它甚至可能吗?如果我想查找Action:ActionType = 1的所有记录,例如.感谢帮助!

rest curl hbase

6
推荐指数
1
解决办法
3590
查看次数

CDH Hue和Hbase身份验证

我是CDH的新手(我使用的当前版本是5.7.1)

我已经添加了HBase thrift角色并在Hue中设置,但我仍然遇到以下问题.

错误图片

HBase Browser   Failed to authenticate to HBase Thrift Server, check authentication configurations. 
Run Code Online (Sandbox Code Playgroud)

有人可以帮我吗?

hbase thrift hue

5
推荐指数
1
解决办法
2138
查看次数