默认,JupyterHub通过8000端口被访问,而IP配置为*,其实,更好的是使用0.0.0.0
改变JupyterHub的proxy IP及端口
jupyterhub --ip=192.168.1.2 --port=443
此时,也可以在jupyterhub_config.py
配置
c.JupyterHub.ip = '192.168.1.2'
c.JupyterHub.port = 443
REST API
默认REST API仅在localhost的8081端口监听。Hub Service与proxy的通信是通过REST API进行。
配置proxy的api url
c.ConfigurableHTTPProxy.api_url = 'http://10.0.1.4:5432'
分别配置proxy api的ip与port
# ideally a private network address
c.JupyterHub.proxy_api_ip = '10.0.1.4'
c.JupyterHub.proxy_api_port = 5432
Hub Service在localhost的8081端口监听,它需要被proxy和所有的Spawner访问。
如果Proxy或Spawner是remote或isolate,Hub service需要指定IP地址
c.JupyterHub.hub_ip = '10.0.1.4'
c.JupyterHub.hub_port = 54321
JupyterHub 0.8增加c.JupyterHub.hub_connect_ip
设置
c.JupyterHub.hub_ip = '0.0.0.0' # listen on all interfaces
c.JupyterHub.hub_connect_ip = '10.0.1.4' # ip as seen on the docker network. Can also be a hostname.