连接成功后无法连接到 Mesos 浏览器消息

failed to connect to Mesos browser message after successfully connecting

如你所见,我可以通过浏览器连接到 Mesos 地址:http://ec2-35-180-230-169.eu-west-3.compute.amazonaws.com:5050/#/

但是 2 秒后弹出这个屏幕说 "Failed to connect to ec2-35-180-230-169.eu-west-3.compute.amazonaws.com:5050!"

在 Safari 和 Firefox 上存在同样的问题。

这是状态信息:

"version":"1.7.2","build_date":"2019-04-29 16:49:35","build_time":1556556575.0,"build_user":"root","start_time":1561467923.587283,"elected_time":1561467923.5961607,"id":"c54f9020-25c2-4890-8072-37e591a2f1d6","pid":"master@172.31.47.43:5050","hostname":"paris2x","capabilities":["AGENT_UPDATE"],"activated_slaves":1.0,"deactivated_slaves":0.0,"unreachable_slaves":0.0,"leader":"master@172.31.47.43:5050","leader_info":{"id":"c54f9020-25c2-4890-8072-37e591a2f1d6","pid":"master@172.31.47.43:5050","port":5050,"hostname":"paris2x"},"flags":{"agent_ping_timeout":"15secs","agent_reregister_timeout":"10mins","allocation_interval":"1secs","allocator":"hierarchical","authenticate_agents":"false","authenticate_frameworks":"false","authenticate_http_frameworks":"false","authenticate_http_readonly":"false","authenticate_http_readwrite":"false","authentication_v0_timeout":"15secs","authenticators":"crammd5","authorizers":"local","filter_gpu_resources":"true","framework_sorter":"drf","help":"false","hostname_lookup":"true","http_authenticators":"basic","initialize_driver_logging":"true","ip":"172.31.47.43","log_auto_initialize":"true","logbufsecs":"0","logging_level":"INFO","max_agent_ping_timeouts":"5","max_completed_frameworks":"50","max_completed_tasks_per_framework":"1000","max_unreachable_tasks_per_framework":"1000","memory_profiling":"false","min_allocatable_resources":"cpus:0.01|mem:32","port":"5050","quiet":"false","recovery_agent_removal_limit":"100%","registry":"replicated_log","registry_fetch_timeout":"1mins","registry_gc_interval":"15mins","registry_max_agent_age":"2weeks","registry_max_agent_count":"102400","registry_store_timeout":"20secs","registry_strict":"false","require_agent_domain":"false","role_sorter":"drf","root_submissions":"true","version":"false","webui_dir":"/usr/share/mesos/mesos-1.7.2/build/../src/webui","work_dir":"/var/lib/mesos","zk_session_timeout":"10secs"},"slaves":[{"id":"f071d1c1-1e28-4d17-8ab1-306dfdd47e31-S0","hostname":"localhost","port":5051,"attributes":{},"pid":"slave(1)@127.0.0.1:5051","registered_time":1561467925.269364,"reregistered_time":1561467952.9056547,"resources":{"disk":74229.0,"mem":6958.0,"gpus":0.0,"cpus":2.0,"ports":"[31000-32000]"},"used_resources":{"disk":0.0,"mem":0.0,"gpus":0.0,"cpus":0.0},"offered_resources":{"disk":0.0,"mem":0.0,"gpus":0.0,"cpus":0.0},"reserved_resources":{},"unreserved_resources":{"disk":74229.0,"mem":6958.0,"gpus":0.0,"cpus":2.0,"ports":"[31000-32000]"},"active":true,"version":"1.7.2","capabilities":["MULTI_ROLE","HIERARCHICAL_ROLE","RESERVATION_REFINEMENT","RESOURCE_PROVIDER","RESIZE_VOLUME"]}],"recovered_slaves":[],"frameworks":[],"completed_frameworks":[],"orphan_tasks":[],"unregistered_frameworks":[]}

Mesos UI 使用来自 state.json 端点的 leader_info 来查询领导者。第一个请求转到用户提供的 URL,但随后它尝试直接攻击领导者。在您的示例中,领导者信息是:

"leader_info":{
  "id":"c54f9020-25c2-4890-8072-37e591a2f1d6",
  "pid":"master@172.31.47.43:5050",
  "port":5050,
  "hostname":"paris2x"
},

和 UI 正在尝试连接 '//' + leader_info.hostname + ':' + leader_info.port 所以在你的情况下这将是 //paris2x:5050

要修复此错误,您需要将 master 的主机名更改为可访问的名称或在其前面放置一个外观。