Jacek Laskowski
Jacek Laskowski

Reputation: 74679

How to run Presto discovery service standalone?

How to run Presto Discovery Service standalone so it's neither a coordinator nor a worker? What are the requirements of a HTTP endpoint to become a discovery service for a Presto cluster?

I found this thread on presto-users mailing list where David Phillips wrote:

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).

Does this still hold?

Upvotes: 0

Views: 1108

Answers (1)

Brian Olsen
Brian Olsen

Reputation: 945

Yes, you can run a standalone discovery service. The cases for this are rare and in general I recommend just running it on the coordinator.

On your discovery node:

  1. Download the 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) and untar it to a directory.
  2. Similar to a Presto Server setup, create an /etc directory under the service root and configure the node.properties and jvm.config.
  3. Add the config.properties, which for discovery service is as simple as this.
    http-server.http.port=8081
  1. Update these lines in your coordinator/worker config.properties.
    discovery-server.enabled=false
    discovery.uri=http://discovery.example.com:8081
  1. Restart your services. (Discovery service is started the same way the presto services are started using bin/launcher)
  2. Once all the servers and workers come up, you should be able to check curl -XGET http://discovery.example.com:8081/v1/service and should expect to see some output that contains:
{
  "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"
      }
    },
    ....

  ]
}

Upvotes: 5

Related Questions