gpt4 book ai didi

database - 通过一个流或同时通过多个服务器将数据发送到 hbase 哪个更好?

转载 作者:搜寻专家 更新时间:2023-10-30 19:49:23 24 4
gpt4 key购买 nike

如果这个问题很基础,我很抱歉(我是 nosql 的新手)。基本上我有一个大型的数学过程,我正在拆分并让不同的服务器处理并将结果发送到 hbase 数据库。每个计算数据的服务器都是一个 hbase 区域服务器,并且在上面有节俭。

我在考虑每个服务器处理数据,然后在本地更新 hbase(通过 thrift)。我不确定这是否是最佳方法,因为我不完全理解主(命名)节点将如何处理上传/拆分。

我想知道上传大量数据时的最佳做法是什么(我怀疑总共有几百万行)?将它发送到区域服务器是否可以,还是应该一切都通过主服务器?

最佳答案

来自 this博文,

The general flow is that a new client contacts the Zookeeper quorum (a separate cluster of Zookeeper nodes) first to find a particular row key. It does so by retrieving the server name (i.e. host name) that hosts the -ROOT- region from Zookeeper. With that information it can query that server to get the server that hosts the .META. table. Both of these two details are cached and only looked up once. Lastly it can query the .META. server and retrieve the server that has the row the client is looking for.

Once it has been told where the row resides, i.e. in what region, it caches this information as well and contacts the HRegionServer hosting that region directly. So over time the client has a pretty complete picture of where to get rows from without needing to query the .META. server again.

我假设您直接使用 thrift 接口(interface)。在这种情况下,即使您从特定区域服务器调用任何变更,该区域服务器也仅充当客户端。它将联系 Zookeeper quorum,然后联系 Master 以获取写入数据的区域,并以与从另一个区域服务器写入相同的方式继续。

Is it okay to send it to regional servers or should everything go through the master?

两者是一样的。没有直接写入regionserver这样的东西。必须联系 Master 以确定将输出写入哪个区域。

如果您正在使用 hadoop map-reduce 作业,并使用 Java API 进行 mapreduce 作业,那么您可以使用 TableOutputFormat直接写入 HFiles 而无需通过 HBase API。它比使用 API 快大约 10 倍。

关于database - 通过一个流或同时通过多个服务器将数据发送到 hbase 哪个更好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7638270/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com