Deploying Presto Router#

Installing Router#

Download the Presto router tarball, presto-router-0.286.tar.gz, and unpack it. The tarball will contain a single top-level directory, presto-router-0.286, which we will call the installation directory.

Router needs a data directory for storing logs, etc. We recommend creating a data directory outside of the installation directory, which allows it to be easily preserved when upgrading Presto.

Configuring Router#

Create an etc directory inside the installation directory. Similar to the installation of Presto, this will hold the following configuration:

  • Node Properties: environmental configuration specific to each node

  • JVM Config: command line options for the Java Virtual Machine

  • Config Properties: configuration for the Presto router

  • Router Properties: configuration and rules for running the router

Node Properties#

The node properties file, etc/, shares the same configuration as the main Presto server. Details can be found at Deploying Presto.

JVM Config#

The JVM config file, etc/jvm.config, contains a list of command line options used for launching the Java Virtual Machine.

The following provides an example of etc/jvm.config.


Config Properties#

The config properties file, etc/, contains the configuration for the Presto router web service.

The following provides an example of etc/


If Kerberos authentication is required, adding the following configs:


Router Properties#

Router properties contain some specific rules to run the router.

The following provides an example of etc/router-config.json.

  "groups": [
      "name": "all",
      "members": ["", ""],
      "weights": [1, 5]
  "selectors": [
      "targetGroup": "all"
  "scheduler": "RANDOM_CHOICE",
  "predictor": ""

These properties requires some explanation:

  • groups: The groups of Presto clusters. Each group contains a required name and required members. Each group may also contain an optional weights field for members. Weights are used for some weights-related scheduling algorithms such as weighted random choice.

  • selectors: The selectors to select specific Presto clusters. Allow source, user, clientTags, and targetGroup.

  • scheduler: The type of scheduler used in the router service. See Router Schedulers for details. The default is RANDOM_CHOICE.

  • predictor: An optional URI for the query predictor. The router uses the URI to fetch query resource usage information from the predictor for scheduling. The default is

Running Router#

The installation directory contains the launcher script in bin/launcher. Router can be started as a a daemon by running the following:

bin/launcher start

Alternatively, it can be run in the foreground, with the logs and other output being written to stdout/stderr (both streams should be captured if using a supervision system like daemontools):

bin/launcher run