简体   繁体   English

访问 AWS ec2 本地集群上的仪表板

[英]Access dashboard on AWS ec2 local cluster

I am running a Dask script on a EC2 instance from AWS.我在 AWS 的 EC2 实例上运行 Dask 脚本。 I would like to connect and see the dashboard provided by Dask, but I can't figure out how.我想连接并查看 Dask 提供的仪表板,但我不知道如何操作。

I am creating a Local Cluster on my EC2 instance, the scripts runs fine and I am connecting to my AWS instance via Putty.我正在我的 EC2 实例上创建一个本地集群,脚本运行良好,我正在通过 Putty 连接到我的 AWS 实例。 However, I would like to see the available dashboard: on my PC it is enough to connect to the provided IP and port, but I am not able to do that on the AWS machine.但是,我想查看可用的仪表板:在我的 PC 上连接到提供的 IP 和端口就足够了,但我无法在 AWS 机器上执行此操作。

Once the script is running, this is my output for the "parameters" of the local cluster:脚本运行后,这是我的 output,用于本地集群的“参数”:

<Client: 'inproc://172.31.29.4/7475/1' processes=1 threads=8, memory=27.94 GiB>
LocalCluster(b8be08dd, 'inproc://172.31.29.4/7475/1', workers=1, threads=8, memory=27.94 GiB)
dashboard address: {'dashboard': 8787}

For example, I tried to write 172.32.29.4:8787/status on my browser, but I wasn't able to connect to the dashboard.例如,我尝试在浏览器中172.32.29.4:8787/status ,但无法连接到仪表板。

I already checked this question: How to view Dask dashboard when running on a virtual machine?我已经检查过这个问题: How to view Dask dashboard when running on a virtual machine? However I am using a Local Cluster and I would like to connect to its dashboard from remote.但是我使用的是本地集群,我想从远程连接到它的仪表板。 Is it possible?是否可以? If so, how?如果是这样,如何?

The answer is in the comments, but I will type it out here, so that the original question looks "answered".答案在评论中,但我会在这里输入,以便原始问题看起来“已回答”。

You need two things to connect to a port on an EC2 machine: the external IP, and access.您需要两件事来连接到 EC2 机器上的端口:外部 IP 和访问。 The former is most easily found from the AWS console.前者最容易从 AWS 控制台中找到。 For the latter, you typically need to edit the security group to add an inbound TCP rule for the port (either open to the world, or just your IP).对于后者,您通常需要编辑安全组以为端口添加入站 TCP 规则(向世界开放,或仅您的 IP)。 There are other ways to do this part, depending on whether your machine is inside a VPC, has any custom gateways or routers... but if you don't know what that means, find the security group first.还有其他方法可以做到这一点,具体取决于您的机器是否在 VPC 内,是否有任何自定义网关或路由器……但如果您不知道这意味着什么,请先找到安全组。 Both the public IP and the security group will be linked from the machine's row in the EC2 "running instances" list.公共 IP 和安全组都将从 EC2“运行实例”列表中的机器行链接。

I've setup dask-labextension visualizations to provide this type of UI.我已经设置了 dask-labextension可视化来提供这种类型的 UI。

在此处输入图像描述

Create the client object:创建client object:

from dask.distributed import Client
client = Client()

Then click the magnifying glass provided by the extension to automatically connect with the cluster.然后点击扩展提供的放大镜自动连接集群。

The detailed instructions are in this post .详细说明在这篇文章中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM