更改默认端口时无法运行 Jupyterhub




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

我更改了文件     /etc/jupyterhub/jupyterhub_config.py     添加/取消注释:

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 代理:

554] 在 pid=47639 处停止代理
[W 2020-06-03 14:48:48.932 JupyterHub 代理:643] 在没有 SSL 的情况下运行 JupyterHub。
我希望其他地方发生SSL终止...[I 2020-06-03 14:48:48.932 JupyterHub 代理:646] 启动代理 @ http://111.111.11.1:9002/14:48:49.301 [配置代理] 信息:代理 http://111.111.11.1:9002(无默认值(14:48:49.307 [配置代理] 信息:代理 API 在 http://127.0.0.1:9000/api/routes 14:48:
49.315 [


配置代理] 错误:未捕获异常
[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 await self.start((文件 "/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-packages/jupyterhub/app.py",

第 2524 行,在 start
await self.proxy.get_all_routes((
File "/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-pack#c.JupyterHub.hub_ip = '127.0.0.1'ages/
jupyterhub/proxy.py", 第 806 行,在 get_all_routes
resp = await self.api_request('', client=client(File "/home/user/miniconda/2020.02/python/3.7/lib/python3.7/site-packages/jupyterhub/proxy.py",第 774 行,在 api_request
result = await client.fetch(req(

tornado.httpclient.HTTPClientError: HTTP 403: Forbidden

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

谢谢。

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

JupyterHub有几种不同的服务,而"hub"服务令人困惑,实际上并不是您关心的服务。代理是应用程序的主要入口点,默认情况下,它将流量代理到中心,如果流量是到/user/URL,则代理到特定用户 Jupyter 服务器。

此外,"hub"服务还有一个 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'

最新更新