Соединение JupyterHub отклонено при доступе с использованием завитка

Я следовал QuickStart JupyterHub, чтобы успешно установить JupyterHub на компьютере с Linux и запустить сервис, набрав

jupyterhub

и вывод предполагает, что теперь сервер прослушивает порт 8000:

$ jupyterhub
[I 2018-07-02 02:32:25.756 JupyterHub app:1656] Using Authenticator: jupyterhub.auth.PAMAuthenticator-0.9.0
[I 2018-07-02 02:32:25.756 JupyterHub app:1656] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-0.9.0
[I 2018-07-02 02:32:25.759 JupyterHub app:1014] Loading cookie_secret from /home/ec2-user/jupyterhub_cookie_secret
[I 2018-07-02 02:32:25.775 JupyterHub proxy:429] Generating new CONFIGPROXY_AUTH_TOKEN
[W 2018-07-02 02:32:25.776 JupyterHub app:1160] No admin users, admin interface will be unavailable.
[W 2018-07-02 02:32:25.776 JupyterHub app:1161] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2018-07-02 02:32:25.776 JupyterHub app:1188] Not using whitelist. Any authenticated user will be allowed.
[I 2018-07-02 02:32:25.810 JupyterHub app:1838] Hub API listening on http://127.0.0.1:8081/hub/
[W 2018-07-02 02:32:25.811 JupyterHub proxy:481] Running JupyterHub without SSL.  I hope there is SSL termination happening somewhere else...
[I 2018-07-02 02:32:25.811 JupyterHub proxy:483] Starting proxy @ http://:8000
02:32:26.221 - info: [ConfigProxy] Proxying http://*:8000 to (no default)
02:32:26.223 - info: [ConfigProxy] Proxy API at http://127.0.0.1:8001/api/routes
02:32:26.735 - info: [ConfigProxy] 200 GET /api/routes
[I 2018-07-02 02:32:26.735 JupyterHub proxy:299] Checking routes
[I 2018-07-02 02:32:26.736 JupyterHub proxy:368] Adding default route for Hub: / => http://127.0.0.1:8081
02:32:26.737 - info: [ConfigProxy] Adding route / -> http://127.0.0.1:8081
02:32:26.738 - info: [ConfigProxy] 201 POST /api/routes/
[I 2018-07-02 02:32:26.739 JupyterHub app:1895] JupyterHub is now running at http://:8000

Но когда я пытаюсь получить доступ к серверу по curl, он просто показывает, что он недоступен.

$ curl localhost:8000
curl: (7) Failed to connect to localhost port 8000: Connection refused

Кто-нибудь сталкивался с такой же проблемой? Любой совет высоко ценится!


person Meng Lee    schedule 02.07.2018    source источник


Ответы (1)


После того, как я внес некоторые изменения в jupyterhub_config.py, он стал доступен. И вот мой конфиг:

c = get_config()
c.JupyterHub.bind_url = 'http://localhost:8000'
c.JupyterHub.hub_ip='localhost'

Чтобы сгенерировать jupyterhub_config.py при первой попытке настроить JupyterHub, вы можете ввести:

jupyterhub --generate-config -f /etc/jupyterhub/jupyterhub_config.py

И чтобы запустить jupyterHub с файлом jupyterhub_config.py:

sudo jupyterhub -f /etc/jupyterhub/jupyterhub_config.py
person Meng Lee    schedule 05.07.2018