无法在 Google Cloud Dataflow 虚拟机中使用 ping 命令?

Can't use ping command in Google Cloud Dataflow vm?

通过 SSH 连接到我的 Google Cloud Dataflow worker Compute Engine 实例后,我无法使用 ping 命令来验证与 VPN 隧道的连接。我收到以下错误:

bash: ping: command not found

对任何 ping 服务器的尝试。 我启用了私人 Google 访问并禁用了 public IP,但我的印象是我仍然可以使用 ping 命令。我还注意到此 VM 使用数据流网络标记,但这是有道理的,因为它是数据流作业。是否需要特定配置才能解决此问题?

作为数据流服务的一部分 运行 的工作器在 COS 上是私有的 docker 图像 运行ning。

要使用 运行 ping 命令,您需要执行以下操作:-

  1. SSH 进入worker

  2. 运行 一个 docker ps 命令获取 运行ning

  3. 的容器列表
  4. 识别容器镜像有如下镜像gcr.io/cloud-dataflow/v1beta3/....

  5. 运行命令docker exec -it image_id /bin/bash

最后,您可以 运行 从容器内部执行 ping 操作,如下所示

xxxxxxxx ~ $ docker exec -it yyyyyy /bin/bash

xxxxxx:/# ping google.com
PING google.com (172.217.212.113) 56(84) bytes of data.
64 bytes from 172.217.212.113: icmp_seq=1 ttl=52 time=0.951 ms
64 bytes from 172.217.212.113: icmp_seq=2 ttl=52 time=0.967 ms
64 bytes from 172.217.212.113: icmp_seq=3 ttl=52 time=0.758 ms
64 bytes from 172.217.212.113: icmp_seq=4 ttl=52 time=0.943 ms
64 bytes from 172.217.212.113: icmp_seq=5 ttl=52 time=0.970 ms