【问题标题】:JupyterHub Connection refused when access using curl使用 curl 访问时 JupyterHub 连接被拒绝
【发布时间】:2018-07-05 15:01:49
【问题描述】:

我已经按照JupyterHub的QuickStart在Linux机器上成功安装了JupyterHub,并通过输入启动服务

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

有人遇到过同样的问题吗?任何建议都非常感谢!

【问题讨论】:

    标签: jupyterhub


    【解决方案1】:

    在我对jupyterhub_config.py 进行一些修改后,它就可以访问了。以下是我的配置:

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

    为了在您第一次尝试配置 JupyterHub 时生成jupyterhub_config.py,您可以输入:

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

    然后使用文件jupyterhub_config.py 启动jupyterHub:

    sudo jupyterhub -f /etc/jupyterhub/jupyterhub_config.py
    

    【讨论】:

      猜你喜欢
      • 2020-05-05
      • 1970-01-01
      • 2019-07-11
      • 2021-07-31
      • 1970-01-01
      • 2023-03-23
      • 2019-08-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多