apache-spark - 使用预览图像创建 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
解决方案
我认为问题可能是您的元存储是从旧版本的 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
推荐阅读
- python - 为什么我的套接字似乎在客户端关闭,即使我一直从服务器发出客户端应该监听的消息?
- c# - IEnumerable 概念 - 得到所有和得到一个
- c++ - 如何让多个对象共享值?
- reactjs - React Router 不渲染 Route 组件
- python - 'function' 对象没有属性 'today'
- python - Python 将 json 插入 Postgres
- vba - 如何使用电子邮件中的主题行将附件分类到本地文件夹中?
- json - Spark 应用程序从 JSON 文件中读取动态 JSON 字段的值
- reactjs - CustomEvents 和 React.js 组件
- angular - 自定义验证器不会改变我的 ngClass