默认的MapReduce集群没有访问HBase配置或类的权限,so,我们需要将hbase-site.xml文件放到hadoop的安装目录中的conf文件中,并且还需要在hadoop目录下的lib文件夹中加入HBase的Jar包,然后复制更改到集群或者编辑hadoop-evn.sh文件,添加这些更改到HADOOP_CLASSPATH(不推荐)
接下来,我们看两个简单的demo:
This example will count the number of distinct instances of a value in a table and write those summarized counts in another table.
Configuration config = HBaseConfiguration.create();
Job job = new Job(config,"ExampleSummary

本文介绍了如何在MapReduce集群中配置HBase,包括将hbase-site.xml放入Hadoop的conf目录,添加HBase的Jar包到Hadoop的lib目录,以及可能的HADOOP_CLASSPATH配置。接着通过两个示例展示了HBase作为MapReduce源和HDFS作为数据存储的用法,包括计数特定值的唯一实例并写入新表。
最低0.47元/天 解锁文章
6144

被折叠的 条评论
为什么被折叠?



