【问题标题】:Cant Access Prefect Server Remotely无法远程访问 Prefect 服务器
【发布时间】:2022-01-12 09:45:08
【问题描述】:

我使用命令prefect server start --postgres-port=5433 --server-port=5001 --hasura-port=5002 --graphql-port=5003 --expose 在我的天蓝色网络中允许的端口启动完美服务器。当我执行docker ps 时,我得到了

CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                    PORTS                                   NAMES
873bfa5bd6bc   prefecthq/ui:core-0.15.7       "/docker-entrypoint.…"   23 minutes ago   Up 23 minutes (healthy)   80/tcp, 0.0.0.0:8080->8080/tcp          tmp_ui_1
9ca79a768265   prefecthq/apollo:core-0.15.7   "tini -g -- bash -c …"   23 minutes ago   Up 23 minutes (healthy)   0.0.0.0:5003->4200/tcp                  tmp_apollo_1
ab7c87ddbabb   prefecthq/server:core-0.15.7   "tini -g -- python s…"   23 minutes ago   Up 23 minutes                                                     tmp_towel_1
ef230baeddb5   prefecthq/server:core-0.15.7   "tini -g -- bash -c …"   23 minutes ago   Up 23 minutes (healthy)   127.0.0.1:5001->4201/tcp                tmp_graphql_1
410c38f08f83   hasura/graphql-engine:v1.3.3   "graphql-engine serve"   23 minutes ago   Up 23 minutes (healthy)   127.0.0.1:5002->3000/tcp                tmp_hasura_1
82748fbc9f4d   postgres:11                    "docker-entrypoint.s…"   23 minutes ago   Up 23 minutes (healthy)   127.0.0.1:5433->5432/tcp                tmp_postgres_1

我的~/.prefect/config.toml

[server]
  endpoint = "http://ipaddress:5003/graphql"

  [server.ui]
  apollo_url = "http://ipaddress:5003/graphql"

然后当我启动服务器时,状态如图所示并重定向到 ipaddress:8080/getting-started 页面

我使用docker logs ab7c87ddbabb检查了tmp_towel_1的日志,因为它没有显示健康状态,我发现了一些错误

[Errno 111] Connect call failed ('some_ipaddress_which_i_dont_know_about', 3000)"}

我想是 docker network ip 什么的。没有线索。 谁能建议我可能错在哪里?

【问题讨论】:

    标签: python docker graphql prefect


    【解决方案1】:

    同样的问题是通过社区 Slack 发布的,根据那里的讨论,我们认为解决方案是使用 --server-port 设置端口并且不公开其他端口,因为这些端口仅在各个组件之间内部使用。所以下面的命令应该可以工作:

    prefect server start --server-port=5003 --no-postgres-port --use-volume --expose
    

    然后在 config.toml 中,使用:

    [server]
    endpoint = "http://YOUR_MACHINES_PUBLIC_IP:5003/graphql"
    
      [server.ui]
        apollo_url = "http://YOUR_MACHINES_PUBLIC_IP:5003/graphql"
    
    

    在这里分享给后代。

    【讨论】:

      猜你喜欢
      • 2020-03-06
      • 2013-03-17
      • 2022-06-27
      • 1970-01-01
      • 2015-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多