LoginSignup
1
5

More than 5 years have passed since last update.

GoogleCloudPlatform上でスケールするJupyter環境を構築する

Posted at

下記公式ページにDataProcを利用したJupyter環境について手順があるので、それを元に実際にGCP上でスケールするJupyter環境を構築してみた。公式ページではSOCKSを利用しているが、今回は単純にポートフォワードでJupyter環境に接続し動作確認を行った。
https://cloud.google.com/dataproc/docs/tutorials/jupyter-notebook?hl=ja

CloudDataprocクラスタを作成する

CloudShellから以下のコマンドを実行し、CloudDataprocクラスタを作成する。

$ gcloud dataproc clusters create jupyter-cluster --project $PROJECT --bucket $MYBUCKET --initialization-actions gs://dataproc-initialization-actions/jupyter/jupyter.sh

以下のコマンドでクラスタが正常に起動していることを確認。

$ gcloud dataproc clusters list
NAME             WORKER_COUNT  STATUS   ZONE
jupyter-cluster  2             RUNNING  us-central1-a

クラスタのホスト名を確認

$ gcloud dataproc clusters describe jupyter-cluster
...
  masterConfig:
  ...
    instanceNames:
    - jupyter-cluster-m
  ...
  workerConfig:
  ...   
    instanceNames:
    - jupyter-cluster-w-0
    - jupyter-cluster-w-1
...

Jupyter notebookに接続する

sshポートフォワードを使ってJupyterに接続する。

ssh -L 8123:jupyter-cluster-m:8123 {アカウント名}@{jupyter-cluster-mの外部アドレス}

Screen Shot 2017-04-14 at 9.10.54.png

1
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
5