You are viewing the documentation for Pilosa master. View the latest documentation for Pilosa v0.8.

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, prefxed by PILOSA_, and with any dashes replaced by underscores. For example: --flag-name becomes PILOSA_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.poll-interval=2m0s and --cluster.replicas=1 look like this in the config file:

[cluster]
  poll-interval = "2m0s"
  replicas = 1

Any flag that has a value that is a comma separated list on the command line becomes an array in toml. For example --cluster.hosts=one.pilosa.com:10101,two.pilosa.com:10101 becomes:

[cluster]
  hosts = ["one.pilosa.com:10101", "two.pilosa.com:10101"]

All Options

Anti Entropy Interval

Bind

Data Dir

Log Path

Max Writes Per Request

Gossip Port

Gossip Seed

Gossip Key

Cluster Hosts

Cluster Poll Interval

Cluster Long Query Time

Cluster Replicas

Cluster Type

Profile CPU

Profile CPU Time

Metric Host
Metric Poll Interval
Metric Diagnostics
TLS Certificate
TLS Certificate Key
TLS Skip Verify

Example Cluster Configuration

A three node cluster 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
  type = "gossip"
  hosts = ["node0.pilosa.com:10101","node1.pilosa.com:10101","node2.pilosa.com:10101"]

Node 1

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

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

[cluster]
  replicas = 1
  type = "gossip"
  hosts = ["node0.pilosa.com:10101","node1.pilosa.com:10101","node2.pilosa.com:10101"]

Node 2

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

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

[cluster]
  replicas = 1
  type = "gossip"
  hosts = ["node0.pilosa.com:10101","node1.pilosa.com:10101","node2.pilosa.com:10101"]

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
  type = "gossip"
  hosts = ["https://node0.pilosa.com:10101","https://node1.pilosa.com:10101","https://node2.pilosa.com:10101"]

[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
  type = "gossip"
  hosts = ["https://node0.pilosa.com:10101","https://node1.pilosa.com:10101","https://node2.pilosa.com:10101"]

[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
  type = "gossip"
  hosts = ["https://node0.pilosa.com:10101","https://node1.pilosa.com:10101","https://node2.pilosa.com:10101"]

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