首页 > 解决方案 > 使用预览图像创建 dataproc 集群时无法启动 Cloud SQL Metastore

问题描述

我正在使用 Spark 对一些数据进行一些计算,然后推送到 Hive。Cloud Dataproc 版本为 1.2,其中 包含 Hive 2.1。Hive 中的 Merge 命令仅受 2.2 及更高版本支持。所以我必须对 dataproc 集群使用预览版。当我将 1.2 版用于 dataproc 集群时,我可以毫无问题地创建集群。使用预览版时出现此错误“无法启动 Cloud SQL Metastore ”。初始化脚本在这里。以前有没有人遇到过这个问题?

hive-metastore.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled hive-metastore
mysql.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable mysql
insserv: warning: current start runlevel(s) (empty) of script `mysql` overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
Created symlink /etc/systemd/system/multi-user.target.wants/cloud-sql-proxy.service → /usr/lib/systemd/system/cloud-sql-proxy.service.
Cloud SQL Proxy installation succeeded
hive-metastore.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install is-enabled hive-metastore
[2018-06-06T12:43:55+0000]: Failed to bring up Cloud SQL Metastore

标签: apache-sparkhivegoogle-cloud-platformgoogle-cloud-dataproc

解决方案


我认为问题可能是您的元存储是从旧版本的 Dataproc 初始化的,因此架构已过时。

如果你有失败的集群(如果没有,请像以前一样创建一个新的,你可以使用--single-node选项来降低成本),然后 SSH 到主节点并升级架构:

$ gcloud compute ssh my-cluster-m

$ /usr/lib/hive/bin/schematool -dbType mysql -info
Hive distribution version:       2.3.0
Metastore schema version:        2.1.0    <-- you will need this

org.apache.hadoop.hive.metastore.HiveMetaException: Metastore schema version is
not compatible. Hive Version: 2.3.0, Database Schema Version: 2.1.0
*** schemaTool failed ***

$ /usr/lib/hive/bin/schematool -dbType mysql -upgradeSchemaFrom 2.1.0

不幸的是,这个集群无法恢复到运行状态,所以请删除并重新创建它。

我创建了这个 PR 以使问题更容易被发现: https ://github.com/GoogleCloudPlatform/dataproc-initialization-actions/pull/278


推荐阅读