我尝试用客户端程序将一些数据写入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) 我的HBase集群的负载不平衡,所以我想将表的某些区域从一个regionserver移动到另一个,但是看起来需要一个regionserver的起始码来完成这个,我怎样才能得到这个起始码?
我注意到有人的主状态页面是这样的:

但我的是这样的:

我在哪里可以得到起始码?
实际上,我想将一个区域从regionserver k3移动到regionserver k2,而k3上的区域是:

我怎样才能做到这一点?详细地 :)
HBase如何执行查找并检索记录?例如,RDBMS的B树在HBase中的等效项是什么?
[编辑]
我了解HBase如何解析-ROOT-和.META。表格以找出哪个区域保存数据。但是如何执行本地查找?
为了更好地说明,这是一个示例:
RegionServer X如何找出记录77的位置?
RegionServer是否使用某种查找表(例如RDBMS的B树)作为区域的键?还是需要读取StoreFiles的所有内容(记录从50到77)?
目前我的团队正在创建一个使用HDInsight的解决方案.我们每天将获得5TB的数据,并且需要对这些数据进行一些地图/减少工作.如果我们的数据将存储在Azure表存储而不是Azure HBase中,是否会有任何性能/成本差异?
我正在创建一个值为整数-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 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) 我正在使用来自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
有没有人知道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的所有记录,例如.感谢帮助!
我是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)
有人可以帮我吗?