update doc for configuration

This commit is contained in:
Linh Vo 2017-07-07 15:12:16 -05:00
parent cda46245d8
commit e3090cb0c3
6 changed files with 24 additions and 24 deletions

View file

@ -178,10 +178,10 @@ func TestRootCommand_Config(t *testing.T) {
panic(err)
}
config := `data-dir = "/tmp/pil5_0"
bind = "127.0.0.1:10101"
host = "127.0.0.1:10101"
[cluster]
poll-interval = "2m0s"
polling-interval = "2m0s"
replicas = 2
partitions = 128
hosts = [

View file

@ -44,14 +44,14 @@ func TestServerConfig(t *testing.T) {
tests := []commandTest{
// TEST 0
{
args: []string{"server", "--data-dir", actualDataDir, "--cluster.hosts", "example.com:10111,example.com:10110", "--bind", "example.com:10111"},
env: map[string]string{"PILOSA_DATA_DIR": "/tmp/myEnvDatadir", "PILOSA_CLUSTER.POLL_INTERVAL": "3m2s"},
args: []string{"server", "--data-dir", actualDataDir, "--cluster.hosts", "example.com:10111,example.com:10110", "--host", "example.com:10111"},
env: map[string]string{"PILOSA_DATA_DIR": "/tmp/myEnvDatadir", "PILOSA_CLUSTER.POLLING_INTERVAL": "3m2s"},
cfgFileContent: `
data-dir = "/tmp/myFileDatadir"
bind = "localhost:0"
host = "localhost:0"
[cluster]
poll-interval = "45s"
polling-interval = "45s"
replicas = 2
hosts = [
"localhost:19444",
@ -72,7 +72,7 @@ func TestServerConfig(t *testing.T) {
args: []string{"server", "--anti-entropy.interval", "9m0s"},
env: map[string]string{"PILOSA_CLUSTER.HOSTS": "example.com:1110,example.com:1111", "PILOSA_BIND": "example.com:1110"},
cfgFileContent: `
bind = "localhost:0"
host = "localhost:0"
data-dir = "` + actualDataDir + `"
[cluster]
hosts = [
@ -94,10 +94,10 @@ func TestServerConfig(t *testing.T) {
args: []string{"server", "--log-path", logFile.Name()},
env: map[string]string{"PILOSA_PROFILE.CPU_TIME": "1m"},
cfgFileContent: `
bind = "localhost:19444"
host = "localhost:19444"
data-dir = "` + actualDataDir + `"
[cluster]
poll-interval = "2m0s"
polling-interval = "2m0s"
hosts = [
"localhost:19444",
]

View file

@ -69,7 +69,7 @@ type Config struct {
Metric struct {
Service string `toml:"service"`
Host string `toml:"host"`
PollingInterval Duration `toml:"poll-interval"`
PollingInterval Duration `toml:"polling-interval"`
} `toml:"metric"`
}

View file

@ -43,7 +43,7 @@ bind = "localhost:10101"
max-writes-per-request = 5000
[cluster]
poll-interval = "2m0s"
polling-interval = "2m0s"
replicas = 1
hosts = [
"localhost:10101",
@ -59,7 +59,7 @@ max-writes-per-request = 5000
[metric]
service = "statsd"
host = "127.0.0.1:8125"
poll-interval = "0m15s"
polling-interval = "0m15s"
[plugins]
path = ""

View file

@ -42,5 +42,5 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) {
flags.StringVarP(&srv.Config.Cluster.InternalPort, "cluster.internal-port", "", "", "Port to which pilosa should bind for internal state sharing.")
flags.StringVarP(&srv.Config.Metric.Service, "metric.service", "", "nop", "Default URI on which pilosa should listen.")
flags.StringVarP(&srv.Config.Metric.Host, "metric.host", "", "", "Default URI to send metrics.")
flags.DurationVarP((*time.Duration)(&srv.Config.Metric.PollingInterval), "metric.poll-interval", "", time.Minute*0, "Polling interval metrics.")
flags.DurationVarP((*time.Duration)(&srv.Config.Metric.PollingInterval), "metric.polling-interval", "", time.Minute*0, "Polling interval metrics.")
}

View file

@ -20,10 +20,10 @@ Every command line flag has a corresponding environment variable. The environmen
### Config file
The config file is in the [toml format](https://github.com/toml-lang/toml) 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:
The config file is in the [toml format](https://github.com/toml-lang/toml) 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.polling-interval=2m0s` and `--cluster.replicas=1` look like this in the config file:
```toml
[cluster]
poll-interval = "2m0s"
polling-interval = "2m0s"
replicas = 1
```
@ -47,15 +47,15 @@ Any flag that has a value that is a comma separated list on the command line bec
interval = "10m0s"
```
#### Bind
#### Host
* Description: host:port on which the Pilosa server will listen for requests. Host defaults to localhost and port to 10101.
* Flag: `--bind="localhost:10101"`
* Flag: `--host="localhost:10101"`
* Env: `PILOSA_BIND="localhost:10101"`
* Config:
```toml
bind = localhost:10101
host = localhost:10101
```
#### Cluster Hosts
@ -97,13 +97,13 @@ Any flag that has a value that is a comma separated list on the command line bec
#### Cluster Poll Interval
* Description: Polling interval for cluster.
* Flag: `cluster.poll-interval="1m0s"`
* Env: `PILOSA_CLUSTER.POLL_INTERVAL="1m0s"`
* Flag: `cluster.polling-interval="1m0s"`
* Env: `PILOSA_CLUSTER.POLLING_INTERVAL="1m0s"`
* Config:
```toml
[cluster]
poll-interval = "1m0s"
polling-interval = "1m0s"
```
#### Cluster Replicas
@ -192,11 +192,11 @@ Any flag that has a value that is a comma separated list on the command line bec
##### Metric Poll Interval
* Description: Polling interval for runtime metrics.
* Flag: `metric.poll-interval=”0m15s”`
* Env: `PILOSA_METRIC.POLL_INTERVAL=0m15s`
* Flag: `metric.polling-interval=”0m15s”`
* Env: `PILOSA_METRIC.POLLING_INTERVAL=0m15s`
* Config:
```toml
[metric]
poll-interval = "0m15s"
polling-interval = "0m15s"
```