【问题标题】:Can't use ping command in Google Cloud Dataflow vm?无法在 Google Cloud Dataflow vm 中使用 ping 命令?
【发布时间】:2020-07-27 13:54:32
【问题描述】:

在通过 SSH 连接到我的 Google Cloud Dataflow 工作人员计算引擎实例后,我无法使用 ping 命令来验证与 VPN 隧道的连接。我收到以下错误:

bash: ping: command not found

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

【问题讨论】:

    标签: google-cloud-platform google-compute-engine google-cloud-dataflow ping


    【解决方案1】:

    作为数据流服务的一部分运行的worker是在COS上运行的私有docker镜像。

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

    1. SSH 进入工作人员

    2. 运行docker ps 命令获取正在运行的容器列表

    3. 识别具有以下图像的容器图像gcr.io/cloud-dataflow/v1beta3/....

    4. 运行命令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
    

    【讨论】:

    • 谢谢,你知道是否可以在计算引擎实例上安装 netcat 吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 2015-05-29
    • 1970-01-01
    • 2019-07-08
    • 2018-08-21
    • 2019-01-27
    相关资源
    最近更新 更多