在虚拟机上运行时如何查看 Dask 仪表板? [英] How to view Dask dashboard when running on a virtual machine?

查看:14
本文介绍了在虚拟机上运行时如何查看 Dask 仪表板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我现在正在做的事情:

Here is what I'm doing now:

  • 从我的 Windows 笔记本电脑,我通过 Putty SSH 到 Linux 服务器:IP 地址是 11.11.11.111
  • 启动 Jupyter notebook:nohup jupyter notebook --ip=0.0.0.0 --no-browser &

  • 终端输出显示 Jupyter notebook 正在运行:
  • http://(11.11.11.111 或 127.0.0.1):8889/?token=blahblahblah

在新笔记本中启动单机客户端:

Start single machine client in a new notebook:

from dask.distributed import Client
client = Client()

打印 client 显示仪表板位于 http://127.0.0.1:8787/status,但是,我无法在该 URL 找到仪表板.我也试过 http://11.11.11.111:8787/status 但也没用.

Printing client shows that the dashboard is located at http://127.0.0.1:8787/status, however, I cannot find the dashboard at that URL. I've also tried http://11.11.11.111:8787/status but that didn't work either.

我仍然可以使用 Dask Dataframes 运行我的笔记本中的所有内容,但我就是不知道如何查看仪表板.Bokeh 已安装在服务器上,我正在通过 Anaconda 运行 Jupyter Notebook.

I'm still able to run everything in my notebook with Dask Dataframes just fine, but I just can't figure out how to view the dashboard. Bokeh is installed on server and I'm running Jupyter Notebook through Anaconda.

推荐答案

终于用 SSH Tunneling 搞定了.

Finally figured it out with some SSH Tunneling.

更多背景知识:

  • 本地计算机是一台 Windows 笔记本电脑
  • 远程服务器是一个 CentOS 机器

目标实际上有两个:

  1. 在包含 Dask 代码的远程服务器上运行 Jupyter Notebook

  1. Run Jupyter Notebook on remote server that contains Dask code

从 Notebook 中运行的代码查看 Dask Dashboard

View Dask Dashboard from code running in Notebook

这是我采取的步骤:

  1. 对于这个例子,远程服务器的IP地址是11.11.11.111

遵循 端口隧道,我使用 8001 作为源端口,目标是 localhost:8889

Following some instructions for Port Tunneling, I use 8001 as the Source Port and Destination is localhost:8889

连接到远程服务器(有 16 个内核和 44.7GB 内存)后,我在 Putty 终端中运行了这个:dask-worker tcp://11.11.11.111:8786 --memory-limit=auto --nthreads=1 --nprocs=16 &

After connecting to the remote server (which has 16 cores and 44.7GB of RAM), I ran this in Putty terminal: dask-worker tcp://11.11.11.111:8786 --memory-limit=auto --nthreads=1 --nprocs=16 &

在服务器上启动 Jupyter Notebook:jupyter notebook --ip=0.0.0.0 --port=8889 --no-browser &

Start Jupyter Notebook on server: jupyter notebook --ip=0.0.0.0 --port=8889 --no-browser &

一个.运行上述命令后,输出显示 Jupyter notebook 正在 http://(hostname or 127.0.0.1):8889/?token=blahblahblah

a. After running above command, output shows that Jupyter notebook is running at http://(hostname or 127.0.0.1):8889/?token=blahblahblah

b.打开浏览器并转到上面的 URL (http://hostname:8889/?token=blahblahblah) 会进入 Jupyter Notebook 主页

b. Opening a browser and going to the URL above (http://hostname:8889/?token=blahblahblah) brings to Jupyter Notebook home page

新建 Notebook 并运行以下代码:

Create new Notebook and run following code:

import dask.dataframe as dd
from dask.distributed import Client
client = Client('11.11.11.111:8786')
print(client)

输出显示仪表板

    Client
    Scheduler: tcp://11.11.11.111:8786
    Dashboard: http://11.11.11.111:36124/status
    client = Client('11.11.11.111:8786')

    Cluster
    Workers: 16
    Cores: 16
    Memory: 44.70 GB

现在在浏览器窗口中输入 http://11.11.11.111:36124/status 会将我带到 Dask 仪表板.

Now typing http://11.11.11.111:36124/status into a browser window takes me to the Dask Dashboard.

这篇关于在虚拟机上运行时如何查看 Dask 仪表板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆