【问题标题】:OSError: Timed out trying to connect to Dask Scheduler from GCE to GKE - externalIPOSError:尝试从 GCE 连接到 Dask Scheduler 到 GKE 时超时 - externalIP
【发布时间】:2021-12-24 18:04:52
【问题描述】:

我正在尝试将我的 dask 客户端连接到部署在我的 GKE 上的 dask 调度程序服务。 使用 Helm 完成部署,dask-scheduler 服务的类型为 LoadBalancer,因此它的类型为 externalIP

当尝试从集群内部连接时,使用 Jupyter 可以正常工作。 从 GCE 连接时,使用:

Client('tcp://<scheduler-externalIP>:<scheduler-port>')

我收到超时错误:

`Traceback (most recent call last):
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/comm/core.py", line 319, in connect
handshake = await asyncio.wait_for(comm.read(), time_left())
File "/usr/lib/python3.7/asyncio/tasks.py", line 449, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "parsing.py", line 25, in <module>
client = Client('tcp://34.147.64.50:8786')
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/client.py", line 763, in __init__
self.start(timeout=timeout)
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/client.py", line 945, in start
sync(self.loop, self._start, **kwargs)
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/utils.py", line 327, in sync
raise exc.with_traceback(tb)
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/utils.py", line 310, in f
result[0] = yield future
File "/home/<user>/.local/lib/python3.7/site-packages/tornado/gen.py", line 762, in run
value = future.result()
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/client.py", line 1035, in _start
await self._ensure_connected(timeout=timeout)
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/client.py", line 1096, in _ensure_connected
self.scheduler.address, timeout=timeout, **self.connection_args
File "/home/<user>/.local/lib/python3.7/site-packages/distributed/comm/core.py", line 326, in connect
) from exc
OSError: Timed out during handshake while connecting to tcp://<externalIP>:8786 after 30 s`

【问题讨论】:

  • 你检查你的防火墙规则了吗?如果配置错误,它们可能会阻塞流量。
  • 你好@VinB。有更新吗?

标签: python google-compute-engine google-kubernetes-engine dask-distributed


【解决方案1】:

首先要检查的是 GCP 的防火墙 - 您可能需要 create a rule 才能允许此类连接。

在这种情况下,使用端口 8787,而 Dask 使用常规 TCP 连接。

所以 - 例如,这可能如下所示: gcloud compute firewall-rules create allow-dask-connections --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:8787 --target-tags=your-cluster-node-network-tag 确保防火墙允许流量进入,因为默认情况下 22 和 3389 以外的任何端口都被阻止。

除此之外,GCP 方面并没有多少可以阻止流量。

【讨论】:

猜你喜欢
  • 2019-06-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-09
  • 2016-07-25
  • 2015-11-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多