【问题标题】:failed to run jupyterhub when changing default port更改默认端口时无法运行 jupyterhub
【发布时间】:2020-09-22 03:35:08
【问题描述】:


我正在尝试设置 jupyterhub。 8000用于不同的程序,所以我必须使用不同的端口。

我更改文件      /etc/jupyterhub/jupyterhub_config.py      add/uncmets:

c.JupyterHub.hub_port = 9003
c.JupyterHub.ip = '111.111.11.1'
c.JupyterHub.port = 9002
c.ConfigurableHTTPProxy.api_url = 'http://127.0.0.1:9000'

当我尝试运行 jupyterhub 时,出现错误:

[W 2020-06-03 14:48:48.930 JupyterHub proxy:554] 在 pid=47639 处停止代理
[W 2020-06-03 14:48:48.932 JupyterHub 代理:643] 在没有 SSL 的情况下运行 JupyterHub。
我希望在其他地方发生 SSL 终止...
[我 2020-06-03 14:48:48.932 JupyterHub proxy:646] 启动代理@http://111.111.11.1:9002/
14:48:49.301 [ConfigProxy] 信息:代理 http://111.111.11.1:9002 到(无默认值)
14:48:49.307 [ConfigProxy] 信息:代理 API 位于 http://127.0.0.1:9000/api/routes
14:48:49.315 [ConfigProxy] 错误:未捕获的异常
[E 2020-06-03 14:48:49.437 JupyterHub 应用程序:2718]
回溯(最近一次通话最后一次):
文件“/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-packages/jupyterhub/app.py”,第 2716 行,在 launch_instance_async
等待 self.start()
文件“/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-packages/jupyterhub/app.py”,第 2524 行,开始
等待 self.proxy.get_all_routes()
文件“/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-pack#c.JupyterHub.hub_ip = '127.0.0.1'
年龄/jupyterhub/proxy.py”,第 806 行,在 get_all_routes
resp = await self.api_request('', client=client)
文件“/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-packages/jupyterhub/proxy.py”,第 774 行,在 api_request
结果 = 等待 client.fetch(req)
tornado.httpclient.HTTPClientError: HTTP 403: Forbidden

在8000以外的端口上安装jupyterhub的正确方法是什么?

谢谢。

【问题讨论】:

    标签: jupyter jupyterhub


    【解决方案1】:

    我认为其中一些参数现在已经过时,因此它可能取决于您运行的版本,但我假设 JupyterHub 1.0+。

    JupyterHub 由几个不同的服务组成,而“集线器”服务令人困惑,实际上并不是您所关心的。代理是应用程序的主要入口点,默认情况下它将流量代理到集线器,如果流量是到 /user/ URL,则代理到特定用户 Jupyter 服务器。

    此外,“集线器”服务还有一个 API 端点,用户服务器可以直接访问(这不通过代理)。并且代理也有一个额外的 API 端点,用于从集线器直接访问......

    默认是8000端口的代理服务。要改成80,比如试试这个:

    ## The public facing URL of the whole JupyterHub application.
    #
    #  This is the address on which the proxy will bind. Sets protocol, ip, base_url
    c.JupyterHub.bind_url = 'https://0.0.0.0:80'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-01
      • 2017-08-20
      • 2013-07-10
      • 1970-01-01
      • 2011-10-31
      • 2013-11-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多