【发布时间】:2017-08-13 10:02:31
【问题描述】:
有没有人有使用 HBaseStorage 在 Dataproc 上通过 Pig 从 Bigtable 加载数据的经验或成功?
这是我正在尝试运行的一个非常简单的 Pig 脚本。它失败并显示一个错误,表明它找不到 BigtableConnection 类,我想知道我可能缺少什么设置才能成功从 Bigtable 加载数据。
raw = LOAD 'hbase://my_hbase_table'
USING org.apache.pig.backend.hadoop.hbase.HBaseStorage(
'cf:*', '-minTimestamp 1490104800000 -maxTimestamp 1490105100000 -loadKey true -limit 5')
AS (key:chararray, data);
DUMP raw;
我设置集群的步骤:
- 已启动 Bigtable 集群 (my_bt);创建并填充 my_hbase_table
- 通过 cloud.google.com Cloud Dataproc 控制台启动了 Dataproc 集群 (my_dp)
- 按照https://cloud.google.com/bigtable/docs/installing-hbase-shell 上的说明在 Dataproc 主服务器 (/opt/hbase-1.2.1) 上安装了 HBase shell
- 为
hbase-site.xml添加了 my_bt 和 BigtableConnection 类的属性 - 创建的文件
t.pig包含上面列出的内容 - 通过命令调用 Pig:
gcloud beta dataproc jobs submit pig --cluster my_dp --file t.pig --jars /opt/hbase-1.2.1/lib/bigtable/bigtable-hbase-1.2-0.9.5.1.jar - 出现以下错误,提示找不到 BigtableConnection 类:
2017-03-21 15:30:48,029 [JobControl] 错误 org.apache.hadoop.hbase.mapreduce.TableInputFormat - java.io.IOException: java.lang.ClassNotFoundException: com.google.cloud.bigtable.hbase1_2 .BigtableConnection
【问题讨论】:
-
我建议使用带阴影的 bigtable mapreduce jar,它包含您需要的所有依赖项。去search.maven.org/#search%7Cga%7C1%7Cbigtable%20mapreduce,and下载“shaded.jar”。
-
看起来
,and被自动附加到 @SolomonDuskis 的 URL 中,因为缺少空间来分隔它们;你想访问search.maven.org/#search%7Cga%7C1%7Cbigtable%20mapreduce下载神器。 -
我下载了 shaded.jar 并在提交猪作业时遇到了同样的错误。如果有帮助,我可以上传运行测试时得到的输出。
-
可以试试添加netty-tcnative-boringssl-static吗?见 ttp://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.netty%22%20AND%20a%3A%22netty-tcnative-boringssl-static%22%20AND%20v%3A% 221.1.33.Fork26%22 并下载“jar”
标签: apache-pig bigtable google-cloud-dataproc google-cloud-bigtable hbasestorage