diff --git a/cmd/server.go b/cmd/server.go index f22404d9c..ada93b521 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -75,8 +75,9 @@ on the configured port.`, flags := serveCmd.Flags() flags.StringVarP(&Serve.ConfigPath, "config", "c", "", "Configuration file to read from.") - flags.StringVarP(&Serve.Config.Host, "host", "", ":10101", "Default URI on which pilosa should listen.") flags.StringVarP(&Serve.Config.DataDir, "data-dir", "d", "~/.pilosa", "Directory to store pilosa data files.") + flags.StringVarP(&Serve.Config.Host, "bind", "", ":10101", "Default URI on which pilosa should listen.") + flags.IntVarP(&Serve.Config.Cluster.ReplicaN, "cluster.replicas", "", 1, "Number hosts each piece of data should be stored on.") flags.StringVarP(&Serve.CPUProfile, "cpu-profile", "", "", "Where to store CPU profile.") flags.DurationVarP(&Serve.CPUTime, "cpu-time", "", 30*time.Second, "CPU profile duration.") diff --git a/cmd/server_test.go b/cmd/server_test.go index 4addb447b..a5284ebdb 100644 --- a/cmd/server_test.go +++ b/cmd/server_test.go @@ -51,12 +51,16 @@ func TestServerConfig(t *testing.T) { env: map[string]string{"PILOSA_DATA_DIR": "/tmp/myEnvDatadir"}, cfgFileContent: ` data-dir = "/tmp/myFileDatadir" -host = "localhost:0" +bind = "localhost:0" + +[cluster] + replicas = 2 `, validation: func() error { v := validator{} v.Check(cmd.Serve.Config.DataDir, actualDataDir) v.Check(cmd.Serve.Config.Host, "localhost:0") + v.Check(cmd.Serve.Config.Cluster.ReplicaN, 2) return v.Error() }, },