You are viewing the documentation for Pilosa v0.9. View the latest documentation for Pilosa v0.10.1.

Configuration

Pilosa can be configured through command line flags, environment variables, and/or a configuration file; configured options take precedence in that order. So if an option is specified in a command line flag, it will take precedence over the same option specified in the environment, which would take precedence over that same option specified in the configuration file.

All options are available in all three configuration types with the exception of the --config option which specifies the location of the config file, and therefore will not be used if it is present in the config file.

The syntax for each option is slightly different between each of the configuration types, but follows a simple formula. See the following three sections for an explanation of each configuration type.

Command line flags

Pilosa uses GNU/POSIX style flags. Most flags you specify as --flagname=value although some have a short form that is a single character and can be specified with a single dash like -f value. Running pilosa server --help will give an overview of the available flags as well as their short forms (if applicable).

Environment variables

Every command line flag has a corresponding environment variable. The environment variable is the flag name in all caps, prefixed by PILOSA_, and with dots and dashes replaced by underscores. For example: --scope.flag-name becomes PILOSA_SCOPE_FLAG_NAME.

Config file

The config file is in the toml format and has exactly the same options available as the flags and environment variables. Any flag which contains a dot (“.”) denotes nesting within the config file, so the two flags --cluster.coordinator and --cluster.replicas=1 look like this in the config file:

[cluster]
  coordinator = true
  replicas = 1

All Options

Anti Entropy Interval

Bind

Data Dir

Log Path

Verbose

Max Writes Per Request

Gossip Port

Gossip Seeds

Gossip Key

Cluster Coordinator

Cluster Long Query Time

Cluster Replicas

Cluster Type

Profile CPU

Profile CPU Time

Metric Service

Metric Host

Metric Poll Interval

Metric Diagnostics

TLS Certificate

TLS Certificate Key

TLS Skip Verify

Example Cluster Configuration

A three node cluster running on different hosts could be minimally configured as follows:

Node 0

data-dir = "/home/pilosa/data"
bind = "node0.pilosa.com:10101"

[gossip]
  port = 12000
  seed = "node0.pilosa.com:12000"

[cluster]
  replicas = 1
  coordinator = true

Node 1

data-dir = "/home/pilosa/data"
bind = "node1.pilosa.com:10101"

[gossip]
  port = 12000
  seed = "node0.pilosa.com:12000"

[cluster]
  replicas = 1
  coordinator = false

Node 2

data-dir = "/home/pilosa/data"
bind = "node2.pilosa.com:10101"

[gossip]
  port = 12000
  seed = "node0.pilosa.com:12000"

[cluster]
  replicas = 1
  coordinator = false

Example Cluster Configuration (HTTPS)

The same cluster which uses HTTPS instead of HTTP can be configured as follows. Note that we explicitly specify https as the protocol in bind and cluster.hosts configuration. It is not required to use a gossip key but it is highly recommended:

Node 0

data-dir = "/home/pilosa/data"
bind = "https://node0.pilosa.com:10101"

[gossip]
  port = 12000
  seed = "node0.pilosa.com:12000"
  key = "/home/pilosa/private/gossip.key32"

[cluster]
  replicas = 1
  coordinator = true

[tls]
  certificate = "/home/pilosa/private/server.crt"
  key = "/home/pilosa/private/server.key"

Node 1

data-dir = "/home/pilosa/data"
bind = "https://node1.pilosa.com:10101"

[gossip]
  port = 12000
  seed = "node0.pilosa.com:12000"
  key = "/home/pilosa/private/gossip.key32"

[cluster]
  replicas = 1
  coordinator = false

[tls]
  certificate = "/home/pilosa/private/server.crt"
  key = "/home/pilosa/private/server.key"

Node 2

data-dir = "/home/pilosa/data"
bind = "https://node2.pilosa.com:10101"

[gossip]
  port = 12000
  seed = "node0.pilosa.com:12000"
  key = "/home/pilosa/private/gossip.key32"

[cluster]
  replicas = 1
  coordinator = false

[tls]
  certificate = "/home/pilosa/private/server.crt"
  key = "/home/pilosa/private/server.key"

Example Cluster Configuration (HTTPS, same host)

You can run a cluster on the same host using the configuration above with a few changes. Gossip port and bind adress should be different for each node and a data directory should be accessed only by a single node.

Node 0

data-dir = "/home/pilosa/data0"
bind = "https://localhost:10100"

[gossip]
  port = 12000
  seed = "localhost:12000"
  key = "/home/pilosa/private/gossip.key32"

[cluster]
  replicas = 1
  coordinator = true

[tls]
  certificate = "/home/pilosa/private/server.crt"
  key = "/home/pilosa/private/server.key"

Node 1

data-dir = "/home/pilosa/data1"
bind = "https://localhost:10101"

[gossip]
  port = 12001
  seed = "localhost:12000"
  key = "/home/pilosa/private/gossip.key32"

[cluster]
  replicas = 1
  coordinator = false

[tls]
  certificate = "/home/pilosa/private/server.crt"
  key = "/home/pilosa/private/server.key"

Node 2

data-dir = "/home/pilosa/data2"
bind = "https://localhost:10102"

[gossip]
  port = 12002
  seed = "locahost:12000"
  key = "/home/pilosa/private/gossip.key32"

[cluster]
  replicas = 1
  coordinator = false

[tls]
  certificate = "/home/pilosa/private/server.crt"
  key = "/home/pilosa/private/server.key"

View markdown source on Github. Last updated 6 weeks ago.