質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Jupyter

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

Q&A

0回答

1476閲覧

jupytrhubでログイン後、notebookを起動させたい

alfald

総合スコア19

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Jupyter

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

Docker

Dockerは、Docker社が開発したオープンソースのコンテナー管理ソフトウェアの1つです

0グッド

0クリップ

投稿2020/12/16 06:55

編集2020/12/16 23:02

前提・実現したいこと

仮想マシン OS:centos7

・JupyterHubによる、不特定多数のユーザーがブラウザからアクセスするだけでPythonを実行できる環境の提供
・Dockerコンテナによる、ユーザーごとに隔離された実行サーバの構築

参考にしたページ
https://hiroki-sawano.hatenablog.com/entry/2019/07/12/182044

発生している問題・エラーメッセージ

jupyterhubが起動し、ログインまでできたが、notebookのページが開かない。

404:Not Found You are requesting a page that does not exist!

イメージ説明

該当のソースコード

sudo su - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 5 bash Miniconda3-latest-Linux-x86_64.sh 6 source ~/.bashrc 7 rm Miniconda3-latest-Linux-x86_64.sh 8 conda create -n py37 python=3.7 anaconda 9 conda activate py37 10 conda install -c conda-forge jupyterhub 11 yum install git 12 pip install -e git+https://github.com/jupyterhub/nativeauthenticator.git@919a37460cdb46ef536985c0cb0c1109d5e0e483#egg=jupyterhub_nativeauthenticator 13 cd src/jupyterhub-nativeauthenticator/nativeauthenticator/ 15 pip install dockerspawner 16 yum install -y yum-utils device-mapper-persistent-data lvm2 17 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 18 yum install -y docker-ce docker-ce-cli containerd.io 19 systemctl start docker 20 systemctl enable docker 21 firewall-cmd --add-port=8081/tcp --zone=public --permanent 22 firewall-cmd --reload 23 mkdir /etc/jupyterhub 25 cd /etc/jupyterhub 26 jupyterhub --generate-config 27 vi jupyterhub_config.py 28 vim /lib/systemd/system/jupyterhub.service 29 systemctl enable jupyterhub 30 systemctl start jupyterhub 31 systemctl status jupyterhub 32 vi /etc/sysconfig/selinux 33 reboot 35 conda activate py37 yum -y install httpd vi /etc/httpd/conf/httpd.conf

jupyterhub_config.py

1# JupyterHub自体はlocalhostで起動 2c.JupyterHub.ip = '127.0.0.1' 3 4# Adminユーザを任意の名前で指定 5c.Authenticator.admin_users = {'jupyter'} 6 7# DBはSQLite3 8c.JupyterHub.db_url = 'sqlite:////etc/jupyterhub/jupyterhub.sqlite' 9 10# NativeAuthenticatorを指定 11c.JupyterHub.authenticator_class = 'nativeauthenticator.NativeAuthenticator' 12 13# DockerSpawner関係の設定 14c.JupyterHub.hub_connect_ip = '<仮想サーバーのIP>' 15c.JupyterHub.hub_ip = '0.0.0.0' 16c.JupyterHub.hub_port = 8081 17c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner' 18c.DockerSpawner.hub_connect_ip = '10.0.1.4' 19 20## pandas、matplotlib、seaborn、scikit-learnなどが含まれたscipy-notebookを採用 21## https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-scipy-notebook 22c.DockerSpawner.image = 'jupyter/scipy-notebook:6c3390a9292e' 23 24## ノートブックの永続化設定 25notebook_dir = '/home/jovyan/work' 26c.DockerSpawner.notebook_dir = notebook_dir 27c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }

jupyterhub.conf

1<VirtualHost *:443> 2 ServerAdmin xxx@gmail 3 ServerName www.example.com:80 4 5 # Configure SSL 6 #SSLEngine on 7 #SSLProtocol all -SSLv2 -SSLv3 8 #SSLCipherSuite HIGH:3DES:!aNULL:!MD5:!SEED:!IDEA 9 #SSLCertificateFile <ssl-certificate-file> 10 #SSLCertificateKeyFile <ssl-certificate-key-file> 11 #SSLCertificateChainFile <ssl-certificate-chain-file> 12 13 # Use RewriteEngine to handle websocket connection upgrades 14 RewriteEngine On 15 RewriteCond %{HTTP:Connection} Upgrade [NC] 16 RewriteCond %{HTTP:Upgrade} websocket [NC] 17 RewriteRule /(.*) ws://127.0.0.1:8000/$1 [P,L] 18 19 <Location "/"> 20 # Preserve Host header to avoid cross-origin problems 21 ProxyPreserveHost on 22 # Proxy to JupyterHub 23 ProxyPass http://127.0.0.1:8000/ 24 ProxyPassReverse http://127.0.0.1:8000/ 25 </Location> 26</VirtualHost>

試したこと

/lib/systemd/system/jupyterhub.serviceのファイルに書き足し

After=syslog.targer network.target

ログインした時のログを見た。
気になった箇所として

Config option `hub_connect_ip` not recognized by `DockerSpawner`. Did you mean one of: `container_ip, hub_ip_connect`?

があったため、調べたがわからなかった。

notebookが入っていないかを確認
conda install -c conda-forge notebook
conda install notebook

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

chihatail

2021/01/24 14:06

私も全く同じところでつまずいています。何度も繰り返すうちに20回に一回はエラーが出ないことがあり、設定内容などに問題がなさそうなのですが、その後そちらはいかがでしょうか。 海外のトラブルシューティングのページでjupyterhubをpipでアップグレードすると良い等、色々と試したのですが駄目でした。。。 私も引き続き調べてみたいですが、うまくいきましたら教えていただけると幸いです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問