无法在受限数据处理设置中安装 JUPYTER

Failed to install JUPYTER in restricted dataproc setup

我希望使用 Jupter 可选组件设置数据处理集群。

gcloud beta dataproc clusters create cluster-1ea3 --enable-component-gateway \
--region europe-west1 --subnet data-network --no-address --zone europe-west1-b \
--single-node --master-machine-type n1-standard-4 --master-boot-disk-size 500 \
--image-version 1.5-debian10 --optional-components ANACONDA,JUPYTER \
--scopes 'https://www.googleapis.com/auth/cloud-platform' --project clouddemoenvironment

“--no-address”确保私有 IP 和网络“数据网络”启用 Google 私有访问。如果我不安装 Jupyter 可选组件但群集无法使用可选组件出现以下错误,则一切正常。

<13>Nov  5 09:01:44 google-dataproc-startup[1466]: <13>Nov  5 09:01:44 activate-component-jupyter[2710]: Looking in links: /opt/dataproc/jupyter/gcp
<13>Nov  5 09:01:44 google-dataproc-startup[1466]: <13>Nov  5 09:01:44 activate-component-jupyter[2710]: Collecting https://github.com/GoogleCloudPlatform/jupyter-extensions/archive/2cb9d24fe01cd329a8c4352a07b0eb8f9771fb07.zip#subdirectory=jupyter-gcs-contents-manager (from -r /opt/dataproc/jupyter/jupyter_extra_packages.requirements (line 1))
<13>Nov  5 09:01:59 google-dataproc-startup[1466]: <13>Nov  5 09:01:59 activate-component-jupyter[2710]:   WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f6b1afbac10>, 'Connection to github.com timed out. (connect timeout=15)')': /GoogleCloudPlatform/jupyter-extensions/archive/2cb9d24fe01cd329a8c4352a07b0eb8f9771fb07.zip

我知道集群无法访问 github 并且失败是有道理的。在检查文档时它被引用

If you create a Dataproc cluster with internal IP addresses only, attempts to access github.com over the Internet in an initialization action will fail unless you have configured routes to direct the traffic through Cloud NAT or a Cloud VPN. Without access to the Internet, you can enable Private Google Access, and place job dependencies in Cloud Storage; cluster nodes can download the dependencies from Cloud Storage from internal IPs.

我不想使用 Cloud NAT 或 Cloud VPN。有什么我可以传达给系统以不同方式解决依赖关系的东西吗?不幸的是,初始化脚本概念可能也不会起作用,因为执行顺序在可选组件之后。

关于如何在非 Internet 环境中利用可选组件的任何建议。

此致, 吉尔

这种启动时间依赖性是最新 Dataproc 映像中的一个错误。

应该会在下一个 Dataproc 次要映像版本中修复。

要暂时解决此问题,您可以使用以前的次要映像版本。 (--image-version=1.5.18-debian10)

更新:此问题已在 Nov 9 2020 release 中修复,因此您可以使用最新版本。