如何 运行 Presto 发现服务独立?

How to run Presto discovery service standalone?

如何 运行 Presto Discovery Service 独立以便它既不是协调器也不是工作器?要成为 Presto 集群的发现服务,HTTP 端点有哪些要求?

我在 presto-users 邮件列表上找到 this thread,其中 David Phillips 写道:

If you want to run discovery as a standalone service, separate from Presto, that is an option. We used to publish instructions for doing this, but got rid of them years ago, as running discovery inside the coordinator worked fine (even on large clusters with hundreds of machines).

这还成立吗?

是的,您可以 运行 一个独立的发现服务。这种情况很少见,一般来说,我建议只 运行 在协调器上使用它。

在您的发现节点上:

  1. 下载 discovery service tar.gz with the version that is compatible with your Presto nodes. (e.g. presto version 347 is compatible with discovery service 1.29) 并将其解压到一个目录。
  2. 类似于 Presto Server 设置,在服务根目录下创建一个 /etc 目录并配置 node.properties and jvm.config.
  3. 添加config.properties,发现服务就这么简单
    http-server.http.port=8081
  1. 更新 coordinator/worker config.properties.
  2. 中的这些行
    discovery-server.enabled=false
    discovery.uri=http://discovery.example.com:8081
  1. 重新启动您的服务。 (发现服务的启动方式与 presto services are started 使用 bin/launcher 的方式相同)
  2. 一旦所有服务器和工作人员都启动,您应该能够检查 curl -XGET http://discovery.example.com:8081/v1/service 并且应该会看到一些包含以下内容的输出:
{
  "environment": "production",
  "services": [
    {
      "id": "d2b7141e-d83f-4d23-be86-285ff2a9f53d",
      "nodeId": "57ac8bd3-c55e-4170-b363-80d10023ece8",
      "type": "presto",
      "pool": "general",
      "location": "/57ac8bd3-c55e-4170-b363-80d10023ece8",
      "properties": {
        "node_version": "347",
        "coordinator": "true",
        "http": "http://coord.example.com:8080",
        "http-external": "http://coord.example.com:8080",
        "connectorIds": "system"
      }
    },
    {
      "id": "f0abafae-052a-4758-95c6-d19355043bc6",
      "nodeId": "57ac8bd3-c55e-4170-b363-80d10023ece8",
      "type": "presto-coordinator",
      "pool": "general",
      "location": "/57ac8bd3-c55e-4170-b363-80d10023ece8",
      "properties": {
        "http": "http://coord.example.com:8080",
        "http-external": "http://coord.example.com:8080"
      }
    },
    {
      "id": "1f5096de-189e-4e25-bac3-adc079981d86",
      "nodeId": "8d7e820f-dd01-4227-ad6e-f74b97202647",
      "type": "presto",
      "pool": "general",
      "location": "/8d7e820f-dd01-4227-ad6e-f74b97202647",
      "properties": {
        "node_version": "347",
        "coordinator": "false",
        "http": "http://worker1.example.com:8080",
        "http-external": "http://worker1.example.com:8080",
        "connectorIds": "system"
      }
    },
    ....

  ]
}