马拉松休息 api returns 没有数据

marathon rest api returns no data

我在 HA 中有 3 个马拉松服务器 运行。当我到达领导者的其余部分 api 时,它 returns 很好的数据。但是当我针对其中一个非领导节点尝试它时,我没有得到任何数据......根本没有字符串。 headers 说 200... 但没有数据。有人以前经历过吗?

这是我在领导者身上看到的

# curl -i http://10.0.0.1:8080/v2/apps
HTTP/1.1 200 OK
X-Marathon-Leader: http://x1-master-0:8080
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Content-Type: application/json; qs=2
Connection: close
Server: Jetty(8.y.z-SNAPSHOT)

{"apps":[]} 

这里是非领导者的数据

# curl -i http://10.0.0.2:8080/v2/apps
HTTP/1.1 200 OK
Connection: close
Server: Jetty(8.y.z-SNAPSHOT)

问题是马拉松服务器无法通过名称相互解析。将其他马拉松服务器的主机名添加到每个马拉松的 /etc/hosts 文件中解决了这个问题。