使用 Jupyter 安装 Google Dataproc 时出现 SSH 错误

SSH error when installing Google Dataproc with Jupyter

我已经用 Jupyter (https://cloud.google.com/dataproc/tutorials/jupyter-notebook) 安装了 Google DataProc 集群。通过使用以下命令:

gcloud dataproc clusters create reco-test --zone=europe-west1-d  --master-machine-type n1-standard-2 --master-boot-disk-size 100 --num-workers 2 --worker-machine-type n1-standard-2 --worker-boot-disk-size 50 --project *project* --bucket *bucket* --initialization-actions  gs://dataproc-initialization-actions/jupyter/jupyter.sh`

很有魅力。之后我尝试做SSH转发,但是出现错误:

gcloud compute ssh --zone=europe-west1-d --ssh-flag="-D 10000" --ssh-flag="-N" --ssh-flag="-n" "reco-test-m" &

给出的错误可以在下图中找到错误1。

如果我删除“-D”

gcloud compute ssh --zone=europe-west1-d --ssh-flag="10000" --ssh-flag="-N" --ssh-flag="-n" "reco-test-m" &

给出的错误可以在下图中找到错误2。

如果我删除“--ssh-flag=”-n“”

gcloud compute ssh --zone=europe-west1-d --ssh-flag="10000" --ssh-flag="-N" --ssh-flag="-n" "reco-test-m" &`

给出的错误可以在下图中找到错误3。

有没有人可以帮我解决这个问题?

enter image description here

您似乎遇到了关于 windows 中参数解析方式的已知问题:https://github.com/GoogleCloudPlatform/dataproc-initialization-actions/issues/22

尝试将 -D 10000 分成两个单独的标志:

--ssh-flag="-D" --ssh-flag="10000"

此外,-n 标志仅在后台 运行 需要,在 Windows 中不受支持。一般来说,无论如何将它 运行 保留在前台可能更方便,因此您可以轻松地 ctrl+C 在使用完隧道后终止隧道的过程,而无需处理后台进程(尽管运行删除集群后,它在后台仍会自动终止。

更新:由于拆分标志在 posix 系统中也有效,我更新了 documentation 现在使用单独的 --ssh-flag 参数并且更好地解释了离开 -n 当 运行 在前台时标记。