【发布时间】:2018-02-03 13:39:23
【问题描述】:
我曾经使用 Datapoc(图像版本 1.1)和 Zeppelin 0.62 创建存储在 Google Cloud Bucket 中的配置单元表。现在,我按照https://zeppelin.apache.org/docs/0.7.1/interpreter/spark.html 创建了另一个使用 Zeppelin 0.71 的 Dataproc 1.2 版。完全初始化每个外部组件(MySQL 服务器上的 Hive Metastore,Zeppelin)后,我使用
查询所有配置单元表%sql
show tables
但未返回从先前版本的 Dataproc 创建的表。我重新检查了 zeppelin.sh 和 cloud-sql-proxy.sh 的初始化脚本,它们是正确的。然后我重新检查了hive.metastore.warehouse.dir 的值,它与以前版本的Dataproc 中使用的值匹配,但这次Spark 2.2.0 改为spark.sql.warehouse.dir(请参阅https://issues.apache.org/jira/browse/SPARK-15034)。
然后我创建了一个新的 hive 表 table_zeppelin,并且内容正确存储在存储桶中。当我通过show tables 验证它时,表格按预期显示。但是,一旦我重新启动 Zeppelin 并重新运行 show tables,我什么也没得到。奇怪..因为table_zeppelin 的内容已经在桶中了。一旦我验证了存储 hive 元存储的 MySQL 实例中的表 TBLS,我就没有看到 table_zeppelin。我猜 Hive Metastore 有问题。
令人惊讶的是,当我创建另一个 hive 表时,table_spark 但这次通过 spark-shell 一切都按预期工作。当我运行 show tables 时,我得到了 table_spark 以及在之前的 Dataproc 版本中创建的所有表,但不是之前通过 Zeppelin 0.71 创建的 table_zeppelin。 table_spark 也在 MySQL 实例的表 TBLS 中。我很确定在 Zeppelin 0.71 中设置 hive Metastore 有问题,因为 Zeppelin 无法读取/写入任何内容到 Metastore。我可以确认在 zeppelin-env.sh 中正确设置了 SPARK_HOME 以指向 Dataproc Spark。
这是我的集群创建脚本:
gcloud dataproc --region us-west1 clusters create coco-cluster --bucket rcom_dataproc_dev --zone us-west1-a --master-machine-type n1-highmem-4 --master-boot-disk-size 500 --num-workers 3 --worker-machine-type n1-highcpu-8 --worker-boot-disk-size 500 --image-version 1.2 --project true-dmp --initialization-actions 'gs://dmp_recommendation_dev/env_dependencies/cloud-sql-proxy.sh','gs://dmp_recommendation_dev/env_dependencies/zeppelin.sh' --scopes cloud-platform --properties hive:hive.metastore.warehouse.dir=gs://rcom_dataproc_dev/hive-warehouse --metadata "hive-metastore-instance=true-dmp:asia-northeast1:rcom-metastore-sql,hive-metastore-db=hive_metastore_dev"
注意存储 hive Metastore 的 MySQL 实例在亚洲,但集群在美国。我不认为这是造成这种情况的原因。
所以我的问题是如何设置 Zeppelin 0.71 以识别 Google Cloud SQL 实例中的 Hive Metastore?
谢谢
Peeranat F.
【问题讨论】:
标签: apache-spark hive apache-zeppelin google-cloud-dataproc