在远程计算机上运行OSRM docker

在远程计算机上运行OSRM docker,docker,osrm,Docker,Osrm,我正在尝试在远程计算机上运行OSRM docker。我按照上面提到的安装说明进行操作 在执行上述指令后,我能够运行docker并获得本地结果 // this gives me proper response. curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" // but when I tried with my remote machine IP t

我正在尝试在远程计算机上运行OSRM docker。我按照上面提到的安装说明进行操作

在执行上述指令后,我能够运行docker并获得本地结果

// this gives me proper response.
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"

// but when I tried with my remote machine IP then is giving
// Failed to connect to my_remote_ip port 5000: Connection timed out
curl "http://my_remote_ip:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"

在使用GCE实例时,只需发布一个基于的答案来解释防火墙范围

Linux/Windows防火墙规则(
iptables
firewalld
等)将在操作系统级别运行。但是,请考虑实例本身存在于VPC中,VPC操作自己的防火墙规则。 这意味着,如果您有一个传入请求,它将在进入实例之前首先命中VPC。这意味着您需要在GCE防火墙级别单独管理来自操作系统防火墙的流量

:

防火墙规则适用于网络中的传出(出口)和传入(入口)流量。防火墙规则控制流量,即使流量完全在网络内,包括VM实例之间的通信


最后,您必须考虑在两个地方配置规则以避免这种情况。

基于您所发布的内容,它看起来只是实例没有传入流量的任何。您尝试添加它们了吗?@yyyyahir感谢您的重播。我检查了防火墙规则。更新防火墙规则后,它开始正常工作。感谢您的帮助。添加了一个答案,以澄清GCE防火墙在这些情况下是如何工作的。
// this gives me proper response.
curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"

// but when I tried with my remote machine IP then is giving
// Failed to connect to my_remote_ip port 5000: Connection timed out
curl "http://my_remote_ip:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"