简体   繁体   中英

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

I am unable to use the ping command after SSHing into my Google Cloud Dataflow worker Compute Engine instance in order to verify connectivity to a VPN tunnel. I receive the following error:

bash: ping: command not found

on any attempts to ping a server. I have enabled Private Google Access as well as disabled public IPs but I was under the impression that I would still be able to use the ping command. I've also noticed that this VM uses the Dataflow.network tag, but this makes sense as it is a Dataflow job. Is there a specific configuration required in order to resolve this issue?

The workers that are run as part of dataflow service are private docker images running on COS.

To run ping command you will need to do the following:-

  1. SSH Into the worker

  2. Run a docker ps command to get the list of containers that are running

  3. Identify the container image which has the following image gcr.io/cloud-dataflow/v1beta3/....

  4. Run the command docker exec -it image_id /bin/bash

Finally you can run a ping from inside the container as below

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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