You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Glue Jupyter容器中切换至Jupyter Notebook而非Labs?

切换AWS Glue容器中的Jupyter Lab到Notebook的方法

方法1:直接访问Notebook路径(无需修改容器)

直接在浏览器访问 127.0.0.1:8888/tree,即可进入传统的Jupyter Notebook界面,无需调整容器内的服务。

方法2:进入容器切换启动Notebook

如果需要默认启动Notebook而非Lab,可按以下步骤操作:

  1. 进入容器的bash环境:
    docker exec -it glue_jupyter bash
    
  2. 停止当前运行的Jupyter服务:
    先查看Jupyter进程ID:
    ps aux | grep jupyter
    
    用kill命令终止对应进程(替换<pid>为查到的进程号):
    kill <pid>
    
    或者直接执行:
    jupyter server stop
    
  3. 启动Jupyter Notebook服务(需绑定0.0.0.0确保外部可访问):
    jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser
    
  4. 回到宿主机浏览器,访问127.0.0.1:8888即可进入Notebook界面。

方法3:重新启动容器时指定Notebook启动命令

如果还没启动容器,或者可以重新创建容器,直接替换启动命令为Notebook的启动指令:

docker run -itd -p 8888:8888 -p 4040:4040 --name glue_jupyter amazon/aws-glue-libs:glue_libs_2.0.0_image_01 jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser

方法4:修改Jupyter配置默认打开Notebook

进入容器后,修改Jupyter配置文件,让服务默认加载Notebook界面:

  1. 进入容器bash:
    docker exec -it glue_jupyter bash
    
  2. 生成或编辑Jupyter配置文件:
    如果没有配置文件,先生成:
    jupyter notebook --generate-config
    
    编辑配置文件(路径通常为/home/glue_user/.jupyter/jupyter_notebook_config.py):
    vi /home/glue_user/.jupyter/jupyter_notebook_config.py
    
  3. 找到并修改以下配置项(如果没有就添加):
    # 旧版本Jupyter用这个
    c.NotebookApp.default_url = '/tree'
    # 新版本Jupyter可能用ServerApp
    c.ServerApp.default_url = '/tree'
    
  4. 重启Jupyter服务后,访问127.0.0.1:8888就会默认进入Notebook界面。

内容的提问来源于stack exchange,提问作者Shivam Anand

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 16:10:42